From 990c5bec91888f772bb8661297605b5f1c242644 Mon Sep 17 00:00:00 2001 From: Prototik Date: Sun, 25 May 2014 18:02:15 +0800 Subject: [PATCH] Fix potential NPE in TileEnergyConverter --- common/buildcraft/energy/TileEnergyConverter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/buildcraft/energy/TileEnergyConverter.java b/common/buildcraft/energy/TileEnergyConverter.java index ad1cd2e5..7d6f96a3 100644 --- a/common/buildcraft/energy/TileEnergyConverter.java +++ b/common/buildcraft/energy/TileEnergyConverter.java @@ -139,6 +139,9 @@ public class TileEnergyConverter extends TileBuildCraft implements IPowerRecepto if (tile instanceof IPowerReceptor && mjStored > 0) { IPowerReceptor receptor = (IPowerReceptor) tile; PowerHandler.PowerReceiver powerReceiver = receptor.getPowerReceiver(side.getOpposite()); + if (powerReceiver == null) { + continue; + } double wantToUse = Math.min(mjStored, powerReceiver.getMaxEnergyReceived()); if (wantToUse > powerReceiver.getMinEnergyReceived()) { powerReceiver.receiveEnergy(PowerHandler.Type.MACHINE, wantToUse, side);