Blood Magic

Blood Magic

90M Downloads

Null Pointer Exception When Filtering Node is Used

Z-Doctor opened this issue ยท 8 comments

commented

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:

  1. Place down a blood tank
  2. Place down and input/output node on top of the tank
  3. or 4. Insert a Fluid Filter
  4. or 3. Connect to a master node.
    -optional-
  5. 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.

commented

1.10.2-2.1.9-78.jar
1.11

Are you sure about that?

commented

Also, unable to reproduce. https://streamable.com/qv9gp

Maybe providing the crash log would help?

commented

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).

commented

Dangit Way.

commented

MB

commented

I'm just surprised that no one noticed sooner.

commented

While I have you attention. I would recheck issues 1138 again. I updated the details ;)

commented

I get notifications. You don't have to tell me.