mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 15:57:55 +00:00
Add null check when determining potential tanks to import (#116)
It seems that implementers of IFluidHandler sometimes return null in `getTankInfo()`, so this adds a check for that before doing the bus work.
This commit is contained in:
1 parent
c174db3f15
commit
508f6e5d64
1 file changed
+6
-2
@@ -68,11 +68,15 @@ public class PartFluidImportBus extends FCSharedFluidBus {
|
||||
if (te instanceof IFluidHandler) {
|
||||
try {
|
||||
final IFluidHandler fh = (IFluidHandler) te;
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getFluidInventory();
|
||||
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
|
||||
if (tanksInfo == null) {
|
||||
return TickRateModulation.SLOWER;
|
||||
}
|
||||
|
||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getFluidInventory();
|
||||
int maxDrain = this.calculateAmountToSend();
|
||||
boolean drained = false;
|
||||
FluidTankInfo[] tanksInfo = fh.getTankInfo(this.getSide().getOpposite());
|
||||
|
||||
for (FluidTankInfo tankInfo : tanksInfo) {
|
||||
if (tankInfo.fluid == null) {
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user