mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-22 13:10:13 +00:00
#2584 don't crash on empty fluid containers
This commit is contained in:
1 parent
b6f67c57e3
commit
ae2c783e1e
1 file changed
+2
-1
@@ -250,7 +250,8 @@ public class FluidUtil {
|
||||
if (source != null && source.getItem() != null) {
|
||||
|
||||
if (source.getItem() instanceof IFluidContainerItem) {
|
||||
IFluidTank targetTank = tank.getInputTank(((IFluidContainerItem) source.getItem()).getFluid(source));
|
||||
FluidStack fluid = ((IFluidContainerItem) source.getItem()).getFluid(source);
|
||||
IFluidTank targetTank = fluid != null ? tank.getInputTank(fluid) : null;
|
||||
if (targetTank != null) {
|
||||
FluidStack target = targetTank.getFluid();
|
||||
int maxDrain = targetTank.getCapacity() - (target != null ? target.amount : 0);
|
||||
|
||||
Reference in new issue
Block a user