diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6e0b8b1ef..9df81a469 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -3945,7 +3945,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!units.empty()) { - if (unit->GetTypeId() != TYPEID_PLAYER) + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return; if (units.size() >= e.event.nearPlayer.minCount) @@ -3961,7 +3961,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!units.empty()) { - if (unit->GetTypeId() != TYPEID_PLAYER) + if (!unit || unit->GetTypeId() != TYPEID_PLAYER) return; if (units.size() < e.event.nearPlayerNegation.minCount)