mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Avoid possible null dereference
This commit is contained in:
parent
42b9a6daaf
commit
a5b0ef0912
@ -230,7 +230,8 @@ namespace CSMWorld
|
||||
for (int i=0; i<size; ++i)
|
||||
{
|
||||
buffer[newOrder[i]] = std::move(mRecords [baseIndex+i]);
|
||||
buffer[newOrder[i]]->setModified (buffer[newOrder[i]]->get());
|
||||
if (buffer[newOrder[i]])
|
||||
buffer[newOrder[i]]->setModified (buffer[newOrder[i]]->get());
|
||||
}
|
||||
|
||||
std::move (buffer.begin(), buffer.end(), mRecords.begin()+baseIndex);
|
||||
|
@ -58,7 +58,8 @@ namespace CSMWorld
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
buffer[newOrder[i]] = std::move(mRecords[baseIndex+i]);
|
||||
buffer[newOrder[i]]->setModified(buffer[newOrder[i]]->get());
|
||||
if (buffer[newOrder[i]])
|
||||
buffer[newOrder[i]]->setModified(buffer[newOrder[i]]->get());
|
||||
}
|
||||
|
||||
std::move(buffer.begin(), buffer.end(), mRecords.begin()+baseIndex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user