[1.16.5] inventory mixin crash
jeremiahwinsley opened this issue ยท 2 comments
Describe the bug
ItemStack.getTag is marked as nullable, but returning null will crash the game due to this check:
This method is marked as @Nullable
, so returning null is valid here.
I don't know which specific item returned null here, but here's a crash report from this.
https://gist.github.com/jeremiahwinsley/8f192399b1ec777c902dac69c2c0ef7c
Expected behavior
This should not crash when returning null.
Versions
- Forbidden & Arcanus: forbidden_arcanus-16.2.3.jar
- Valhelsia Core: valhelsia_core-16.0.13a.jar
- Forge: 36.2.28
Not sure how that can happen. If you take a look at the condition above you can see that I check if the damage value of the item is 0. And if you look into IForgeItem where this method is implemented you can see that it always returns 0 if the item has no tag.
So in theory the call to stack.getItem() should not be possible if the item has no tag.
Only thing I can think of is that some other mod modifies that method in some way, meaning it's most likely a mod conflict as I never heard of such a crash with this part of the code being present for multiple months now.