From a348056c86ea01280b7e99222abeebe5ec21a101 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 4 Jun 2024 21:09:45 -0500 Subject: [PATCH] check for null target when cancelling jobs --- src/engine/net/client/handlers/AttackCmdMsgHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/net/client/handlers/AttackCmdMsgHandler.java b/src/engine/net/client/handlers/AttackCmdMsgHandler.java index 2566fa8d..759127b2 100644 --- a/src/engine/net/client/handlers/AttackCmdMsgHandler.java +++ b/src/engine/net/client/handlers/AttackCmdMsgHandler.java @@ -87,7 +87,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { //check if we are changing targets, cancel outstanding jobs if so if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.RHELD)) { AttackJob ajR = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).getJob()); - if(!ajR.target.equals(target)){ + if(ajR.target != null && !ajR.target.equals(target)){ playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob(); addedDelay = ajR.getStopTime() - System.currentTimeMillis(); }else{ @@ -97,7 +97,7 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) { AttackJob ajL = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).getJob()); - if(!ajL.target.equals(target)){ + if(ajL.target != null && !ajL.target.equals(target)){ playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob(); addedDelay = ajL.getStopTime() - System.currentTimeMillis(); }else{