From 545cb4cddf158a3ae4b1740ec0a78dae1fbc9ec8 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 10 Sep 2023 13:40:19 -0500 Subject: [PATCH] null check for building pulled --- src/engine/net/client/handlers/AttackCmdMsgHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/net/client/handlers/AttackCmdMsgHandler.java b/src/engine/net/client/handlers/AttackCmdMsgHandler.java index 0f117971..ea34f163 100644 --- a/src/engine/net/client/handlers/AttackCmdMsgHandler.java +++ b/src/engine/net/client/handlers/AttackCmdMsgHandler.java @@ -58,6 +58,8 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler { break; case Building: target = BuildingManager.getBuilding(msg.getTargetID()); + if(target == null) + return true;// early exit for no building pulled Building targetBuilding = (Building) target; if (!targetBuilding.isVulnerable() || targetBuilding.getRank() < 0) return true;// cannot attack destroyed building or protected building