Null check properly

This commit is contained in:
CovertJaguar 2013-08-23 03:05:44 -07:00
parent 4ab4ec3b67
commit c7b00eb4e5

View file

@ -191,7 +191,9 @@ public class TileTank extends TileBuildCraft implements IFluidHandler {
@Override
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
if (resource != null && !resource.isFluidEqual(tank.getFluid()))
if (resource == null)
return null;
if (!resource.isFluidEqual(tank.getFluid()))
return null;
return drain(from, resource.amount, doDrain);
}