Null Pointer Exception When Filtering Node is Used
Z-Doctor opened this issue ยท 8 comments
What happens:
A null pointer exception happens in WayofTime.bloodmagic.routing.RoutingFluidFilter when FluidStack getFluidStackFromItemStack(ItemStack inputStack) is called (line 88). A small oversight when checking the fluidStack.amount as FluidUtil.getFluidContained(inputStack) can return null and does when connected to a Master Node initially. This can cause an error every time the world is load after the initial crash.
What you expected to happen:
Nothing. I would expect it to not crash and wait for an ItemStack that is a liquid tries to go through.
Steps to reproduce:
- Place down a blood tank
- Place down and input/output node on top of the tank
- or 4. Insert a Fluid Filter
- or 3. Connect to a master node.
-optional- - Cry over the loss of your save
Affected Versions (Do not use "latest"):
- BloodMagic:
BloodMagic-1.10.2-2.1.9-78.jar - Minecraft:
1.11 - Forge:
N/A
Comments
I haven't looked at the other code, but while I was developing my add-on I stumbled across this bug. I haven't check the other versions.
Also, unable to reproduce. https://streamable.com/qv9gp
Maybe providing the crash log would help?
It seems only to happen when on a Blood Tank (potential any type of storage device). I think because that is the only time the function is called.
Crash Log (copied relevant parts):
https://pastebin.com/ezfjvQGj
Video of Input Node:
https://streamable.com/17avi
Video of Output Node:
https://streamable.com/3qz2q
I fixed the steps to reproduce.
Also it makes logical sense that it would crash because the function can return null, but there is nothing to check if it is null and assumes it isn't (by calling a method).
While I have you attention. I would recheck issues 1138 again. I updated the details ;)