Skip to content

Commit

Permalink
Fix crash on null fluidStack tank filling. Close #122.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Aug 25, 2014
1 parent 783c207 commit 183a7b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/evilcraft/api/fluids/SingleUseTank.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public boolean canTankAccept(Fluid fluid) {
* @return If this tank can completely contain the given fluid.
*/
public boolean canCompletelyFill(FluidStack fluidStack) {
return getFluidAmount() + fluidStack.amount <= getCapacity();
int amount = (fluidStack != null) ? fluidStack.amount : 0;
return getFluidAmount() + amount <= getCapacity();
}
}

0 comments on commit 183a7b8

Please sign in to comment.