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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);