[#2210] fix for NPE on placing an empty gas-burning generator

This commit is contained in:
brian lewis 2015-03-15 19:26:12 -05:00
parent 7cfc0c5c3f
commit 2a1fe5b3e9

View file

@ -323,8 +323,9 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
{
fuelTank.read(itemStack.stackTagCompound.getCompoundTag("fuelTank"));
boolean isTankEmpty = (fuelTank.getGas() == null);
//Update energy output based on any existing fuel in tank
FuelGas fuel = FuelHandler.getFuel(fuelTank.getGas().getGas());
FuelGas fuel = (isTankEmpty) ? null : FuelHandler.getFuel(fuelTank.getGas().getGas());
if(fuel != null)
{