isActive method could give NullPointerException

A pump with an empty "block list" would cause NullPointerException if
isActive was called.
This commit is contained in:
SandGrainOne 2013-08-13 20:22:55 +02:00
parent 95cbf27ba7
commit a70cabb598

View file

@ -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