fix(Scripts/Scholomance): Fix nullptr crash (#9298)

This commit is contained in:
Skjalf
2021-11-23 15:26:30 -03:00
committed by GitHub
parent a0002afe07
commit 53e9759014

View File

@@ -296,7 +296,7 @@ public:
void SpellHitTarget(Unit* target, const SpellInfo* spellinfo) override
{
uint32 room = 0;
if (spellinfo && spellinfo->Id == SPELL_SHADOW_PORTAL)
if (spellinfo && spellinfo->Id == SPELL_SHADOW_PORTAL && target && me->GetVictim())
{
room = GetData(GANDLING_ROOM_TO_USE);
SetGate(room, CLOSED);