NPE with Desichalkos sword effect
LemADEC opened this issue ยท 8 comments
General Information
Describe the bug:
Tried to use the Desichalkos sword effect in SSP, client crashed on NPE
To Reproduce:
- Hold Desichalkos sword
- Target a block more than 10 m away
- Right click
Expected behavior:
no crash
Environment Versions
Versions:
- Metallurgy: 1.2.4
- Conflicting mod (if regarding mod integration): Unknown
- Other mods you think could cause issues: Unknown
- Forge: 1.12.2-14.23.5.2855
- Minecraft: 1.12.2
- Modpack (if available): https://www.curseforge.com/minecraft/modpacks/worldwarminecraft/files (11.7.0 in dev)
Logging Information
Crash Report (if available):
https://gist.github.com/LemADEC/5be357cc8d1a49d601f112f710926f44
Latest Log (if necessary):
n/a
I can't seem to reproduce this in my dev env, maybe there's more context needed for this to happen
The crash report also refers to line 82 which is the first line of the switch statement where I check the different cases of sideHit, for the code to cause NPE on that line the RayTraceResult variable should be null, but that can't be since I specifically exclude that case via the if statement above that line
The NPE comes from sideHit itself being NULL. Java doesn't support NULL inputs to switch statements.
Issue is reproduced with malisiscore-1.12.2-6.5.1 that notably changes the World::rayTraceBlocks() method.
mmh, what would be the situation when sideHit is null though?
when no blocks are found the RayTraceResult itself is null, but when a Block rayTraceResult exists there has to be one side of the block which was hit by the raytrace ๐ค
I guess so, it's hard to check whether that fixes the issue though since I haven't even been able to reproduce it in the first place.
I'll include it in the next patch version so you can tell me if you're still experiencing this issue
just add MalisisCore to your mods and it'll trigger when you target the sky. Or drop a patched version here?
oh, sorry yeah it's late and I didn't read your previous comment correctly, I'll work on this tomorrow, really need to get some sleep now ๐