Closed Partonetrain closed 4 months ago
I see Bernass is already on it.
Just wanted to mention: The Java code (linked above) doesn't have this issue, findFirst
returns an empty Optional
if the collection is empty (and the whole method returns ""
in this case).
The Kotlin code would need to use something like firstOrNull
instead of first
here and make the whole method nullable probably.
I added a check stack.hasEnchantments()
before any NBT parsing so I could avoid making the method return nullable and add complexity when it's really not useful (at least at first sight, might change opinion in the future as I usually do :P).
The fix commit was pushed now I'm just manually building and uploading the files. Really should look into automating that hahaha
Needs to be uploaded to CurseForge :)
It's under manual review since saturday morning already, I'm not sure what to do about it at this point :(
Edit:
The first fix patched the crash but broke the rest of the mod, oops :P But the second version is the right one and still under review.
The game crashes when trying to render an enchanted book without enchantment data, such as the icon of the advancement Enchanter (
minecraft:story/enchant_item
).Not a Kotlin user, but it looks like there's no check for this
To Reproduce Open Advancements screen
Expected behavior No crash
Screenshots
Please include:
Crash stack:
(crash stack mentions other mods, but the issue happens anywhere with an enchanted book without NBT data)