mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Scripts/SholazarBasin: Fix a possible nullptr dereference issue found by coverity (#26648)
This commit is contained in:
committed by
GitHub
parent
f157d16e2f
commit
3bcda5acf4
@@ -130,7 +130,10 @@ class spell_q12688_detonate_1 : public SpellScript
|
||||
target->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_FLAMES, false, false, &flames);
|
||||
target->GetMap()->SetSpawnGroupInactive(SPAWN_GROUP_FLAMES);
|
||||
for (WorldObject* flame : flames)
|
||||
dynamic_cast<GameObject*>(flame)->DespawnOrUnsummon(20s);
|
||||
{
|
||||
if (GameObject* flame_go = flame->ToGameObject())
|
||||
flame_go->DespawnOrUnsummon(20s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +171,10 @@ class spell_q12688_detonate_2 : public SpellScript
|
||||
target->GetMap()->SpawnGroupSpawn(SPAWN_GROUP_FLAMES, false, false, &flames);
|
||||
target->GetMap()->SetSpawnGroupInactive(SPAWN_GROUP_FLAMES);
|
||||
for (WorldObject* flame : flames)
|
||||
dynamic_cast<GameObject*>(flame)->DespawnOrUnsummon(20s);
|
||||
{
|
||||
if (GameObject* flame_go = flame->ToGameObject())
|
||||
flame_go->DespawnOrUnsummon(20s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user