From 0374c1c5218292b4aad8e86fe0aa883c14388a13 Mon Sep 17 00:00:00 2001 From: firenoo <49818773+firenoo@users.noreply.github.com> Date: Fri, 28 Jul 2023 04:35:52 -0700 Subject: [PATCH] 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 --- .../github/inventory/FluidConvertingInventoryAdaptor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java index 9ea0d087..8d3c45e4 100644 --- a/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java +++ b/src/main/java/com/glodblock/github/inventory/FluidConvertingInventoryAdaptor.java @@ -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 {