Core/Maps: Fixed possible crash when resetting instances

This commit is contained in:
Shauren committed 2012-06-08 14:52:52 +02:00
1 parent 1c0fc0a1ee
commit 32aa983fe2
3 files changed
+16 -5

No files matched your search

@@ -543,7 +543,10 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId)
if (iMap && iMap->IsDungeon())
((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY);
iMap->DeleteRespawnTimes();
if (iMap)
iMap->DeleteRespawnTimes();
else
Map::DeleteRespawnTimesInDB(mapid, instanceId);
// Free up the instance id and allow it to be reused
sMapMgr->FreeInstanceId(instanceId);