From a70cabb598502eccffb564caa9d0ff12051c7afe Mon Sep 17 00:00:00 2001 From: SandGrainOne Date: Tue, 13 Aug 2013 20:22:55 +0200 Subject: [PATCH] isActive method could give NullPointerException A pump with an empty "block list" would cause NullPointerException if isActive was called. --- common/buildcraft/factory/TilePump.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/buildcraft/factory/TilePump.java b/common/buildcraft/factory/TilePump.java index 194e9879..5285ef1e 100644 --- a/common/buildcraft/factory/TilePump.java +++ b/common/buildcraft/factory/TilePump.java @@ -315,7 +315,12 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor @Override public boolean isActive() { BlockIndex next = getNextIndexToPump(false); - return isPumpableFluid(next.x, next.y, next.z); + + if (next != null) { + return isPumpableFluid(next.x, next.y, next.z); + } + + return false; } @Override