age-series / ElectricalAge

Electrical Age (ELN) is a Minecraft Mod offering the ability to perform large-scale in-game electrical simulations.
Other
65 stars 30 forks source link

Fluid Handler NPE #316

Open jrddunbr opened 6 months ago

jrddunbr commented 6 months ago

https://github.com/age-series/ElectricalAge/blob/8a4ba7aaf3075ff911f3d683a14c8af5098b7871/src/main/java/mods/eln/fluid/ElementSidedFluidHandler.kt#L146

crash log

Caeleron commented 6 months ago

@jrddunbr That file doesn't exist in even 1.21.x. I think you meant:

https://github.com/age-series/ElectricalAge/blob/954902ae7ae8fbe85dd95baeb6f8c3818a88486c/src/main/kotlin/mods/eln/fluid/ElementSidedFluidHandler.kt#L139

Caeleron commented 6 months ago

tank.tank.fluid can be null. Would something like this work?

return tank.tank.fluid != null && tank.tank.fluid.getFluid().id == fluid.id
jrddunbr commented 6 months ago

It was moved in the java/kotlin directory split. The bug report was originally for 1.18.3 stable but was apparently replicated on a more recent version. (I have not been able to for 1.22.x since I'm not in a dev env; not sure if you did).

That fix probably can work. I'd put a PR out for it and see if you can somehow replicate the NPE and see that it fixes it.