[#2210] fix for NPE on placing an empty gas-burning generator
This commit is contained in:
parent
7cfc0c5c3f
commit
2a1fe5b3e9
1 changed files with 2 additions and 1 deletions
|
@ -323,8 +323,9 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
||||||
{
|
{
|
||||||
fuelTank.read(itemStack.stackTagCompound.getCompoundTag("fuelTank"));
|
fuelTank.read(itemStack.stackTagCompound.getCompoundTag("fuelTank"));
|
||||||
|
|
||||||
|
boolean isTankEmpty = (fuelTank.getGas() == null);
|
||||||
//Update energy output based on any existing fuel in tank
|
//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)
|
if(fuel != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue