fix(Core/Scripts): missing null checks for GetCharmerOrOwner and GetOwner (#24902)

This commit is contained in:
Francesco Borzì
2026-03-03 01:57:25 +01:00
committed by GitHub
parent 779764383b
commit 0726ac1602
3 changed files with 12 additions and 6 deletions

View File

@@ -2559,7 +2559,7 @@ class spell_gen_vehicle_scaling_aura: public AuraScript
bool Load() override
{
return GetCaster() && GetCaster()->IsPlayer() && GetOwner()->IsCreature();
return GetCaster() && GetCaster()->IsPlayer() && GetOwner() && GetOwner()->IsCreature();
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)

View File

@@ -2674,7 +2674,8 @@ struct npc_controller : public PossessedAI
{
if (!apply)
{
me->GetCharmerOrOwner()->InterruptNonMeleeSpells(false);
if (Unit* charmerOrOwner = me->GetCharmerOrOwner())
charmerOrOwner->InterruptNonMeleeSpells(false);
}
}
};