Metallurgy 4: Reforged

Metallurgy 4: Reforged

466k Downloads

NPE with Desichalkos sword effect

LemADEC opened this issue ยท 8 comments

commented

General Information

Describe the bug:
Tried to use the Desichalkos sword effect in SSP, client crashed on NPE

To Reproduce:

  1. Hold Desichalkos sword
  2. Target a block more than 10 m away
  3. Right click

Expected behavior:
no crash


Environment Versions

Versions:


Logging Information

Crash Report (if available):
https://gist.github.com/LemADEC/5be357cc8d1a49d601f112f710926f44

Latest Log (if necessary):
n/a

commented

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

commented

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.

commented

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 ๐Ÿค”

commented

Maybe adding a check for result.typeOfHit != Type.MISS would help here?

commented

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

commented

just add MalisisCore to your mods and it'll trigger when you target the sky. Or drop a patched version here?

commented

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 ๐Ÿ˜…

commented

sleep first, no urgency :)