Null check properly
This commit is contained in:
parent
4ab4ec3b67
commit
c7b00eb4e5
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue