mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-17 22:41:28 +00:00
Do not try to dereference nullptr in object cache
This commit is contained in:
parent
36b33cc1a5
commit
02ada74fa1
1 changed files with 2 additions and 1 deletions
|
@ -61,7 +61,8 @@ namespace Resource
|
||||||
{
|
{
|
||||||
// If ref count is greater than 1, the object has an external reference.
|
// If ref count is greater than 1, the object has an external reference.
|
||||||
// If the timestamp is yet to be initialized, it needs to be updated too.
|
// If the timestamp is yet to be initialized, it needs to be updated too.
|
||||||
if (itr->second.first->referenceCount() > 1 || itr->second.second == 0.0)
|
if ((itr->second.first != nullptr && itr->second.first->referenceCount() > 1)
|
||||||
|
|| itr->second.second == 0.0)
|
||||||
itr->second.second = referenceTime;
|
itr->second.second = referenceTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue