Add null check for retrieving tank info (#145)

ThaumicTinkerer returns null for sides. Normally this is handled when
it is directly adjacent to the dual interface via a null check, but for
p2ps it is not checked, leading to a NPE. Adds a check for it
This commit is contained in:
firenoo authored and GitHub committed 2023-07-28 13:35:52 +02:00
1 parent b0d67ac917
commit 0374c1c521
1 file changed
+4 -1
@@ -393,7 +393,10 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
if (p2p == invFluidsP2P || p2p == null) continue;
IFluidHandler target = Ae2Reflect.getP2PLiquidTarget(p2p);
if (target == null) continue;
tankInfos.add(target.getTankInfo(p2p.getSide().getOpposite()));
FluidTankInfo[] info = target.getTankInfo(p2p.getSide().getOpposite());
if (info != null) {
tankInfos.add(info);
}
}
} catch (GridAccessException ignore) {}
} else {