fix unloading of null objects

This commit is contained in:
Ted John 2016-07-10 00:00:23 +01:00
parent f7757c7991
commit 324d690eaf
1 changed files with 7 additions and 4 deletions

View File

@ -157,10 +157,13 @@ public:
if (ori != nullptr)
{
Object * loadedObject = ori->LoadedObject;
size_t index = GetLoadedObjectIndex(loadedObject);
UnloadObject(loadedObject);
numObjectsUnloaded++;
if (loadedObject != nullptr)
{
size_t index = GetLoadedObjectIndex(loadedObject);
UnloadObject(loadedObject);
numObjectsUnloaded++;
}
}
}