mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-17 16:10:49 +01:00
Core/Scripts: Fix possible crash
Fix possible NULL dereference crash spotted by Coverity.
This commit is contained in:
@@ -824,10 +824,9 @@ void Map::ScriptsProcess()
|
||||
}
|
||||
|
||||
Creature* cTarget = NULL;
|
||||
if (source) //using grid searcher
|
||||
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
|
||||
if (wSource) //using grid searcher
|
||||
{
|
||||
WorldObject* wSource = dynamic_cast <WorldObject*> (source);
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(wSource->GetPositionX(), wSource->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user