From be14e4173e1d05ff100bc6f276b7c04c138a57ba Mon Sep 17 00:00:00 2001 From: Anuken Date: Fri, 18 Sep 2026 13:58:24 -0400 Subject: [PATCH] Null check for displayFlow --- core/src/mindustry/world/modules/ItemModule.java | 2 +- core/src/mindustry/world/modules/LiquidModule.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/modules/ItemModule.java b/core/src/mindustry/world/modules/ItemModule.java index 59e068a3bf..49240a2f91 100644 --- a/core/src/mindustry/world/modules/ItemModule.java +++ b/core/src/mindustry/world/modules/ItemModule.java @@ -97,7 +97,7 @@ public class ItemModule extends BlockModule{ /** @return a specific item's flow rate in items/s; any value < 0 means not ready.*/ public float getFlowRate(Item item){ - return flow == null ? -1f : displayFlow[item.id] * 60; + return flow == null ? -1f : displayFlow != null ? displayFlow[item.id] * 60 : -1f; } public boolean hasFlowItem(Item item){ diff --git a/core/src/mindustry/world/modules/LiquidModule.java b/core/src/mindustry/world/modules/LiquidModule.java index 23bfc60659..dfbcb8635f 100644 --- a/core/src/mindustry/world/modules/LiquidModule.java +++ b/core/src/mindustry/world/modules/LiquidModule.java @@ -78,7 +78,7 @@ public class LiquidModule extends BlockModule{ /** @return current liquid's flow rate in u/s; any value < 0 means 'not ready'. */ public float getFlowRate(Liquid liquid){ - return flow == null ? -1f : displayFlow[liquid.id] * 60; + return flow == null ? -1f : displayFlow != null ? displayFlow[liquid.id] * 60 : -1f; } public boolean hasFlowLiquid(Liquid liquid){