From a3f4dc7d1d207e89a222e7cdc93ee120fbe52c1f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 30 Oct 2021 21:02:45 -0400 Subject: [PATCH] Fixed #6272 --- core/src/mindustry/entities/comp/BuildingComp.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/entities/comp/BuildingComp.java b/core/src/mindustry/entities/comp/BuildingComp.java index dc5b8748a2..a90efd9ce6 100644 --- a/core/src/mindustry/entities/comp/BuildingComp.java +++ b/core/src/mindustry/entities/comp/BuildingComp.java @@ -1294,10 +1294,15 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc, } public void pickedUp(){ - power.graph.removeList(self()); - power.graph = new PowerGraph(); - power.links.clear(); - power.status = 0f; + if(power != null){ + if(power.graph != null){ + power.graph.removeList(self()); + power.graph = new PowerGraph(); + } + power.links.clear(); + power.status = 0f; + } + } public void removeFromProximity(){