From 8e0e6bb71e49a036df9788574e43313dfef422f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Hillerstr=C3=B6m?= Date: Thu, 12 Feb 2026 20:21:54 +0100 Subject: [PATCH] [APL] Fix nil ref error in apl_helpers.go:GetTargetAPLSpell --- sim/core/apl_helpers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sim/core/apl_helpers.go b/sim/core/apl_helpers.go index 7c2cce2e13..468890aee8 100644 --- a/sim/core/apl_helpers.go +++ b/sim/core/apl_helpers.go @@ -247,11 +247,18 @@ func (rot *APLRotation) GetAPLSpell(spellId *proto.ActionID) *Spell { func (rot *APLRotation) GetTargetAPLSpell(spellId *proto.ActionID, targetUnit UnitReference) *Spell { actionID := ProtoToActionID(spellId) target := targetUnit.Get() + + if target == nil { + rot.ValidationMessage(proto.LogLevel_Warning, "Target not found for spell %s", actionID) + return nil + } + spell := target.GetSpell(actionID) if spell == nil { rot.ValidationMessage(proto.LogLevel_Warning, "%s does not know spell %s", target.Label, actionID) } + return spell }