Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent crash when clicking unknown item in the recipe #255

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

yl-whosit
Copy link

@yl-whosit yl-whosit commented Dec 8, 2024

Got this crash when someone clicked an unknown item in the broken recipe:

ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback on_playerReceiveFields(): ...mods/unified_inventory/register.lua:332: attempt to index local 'item_def' (a nil value)
 ERROR[Main]: stack traceback:
 ERROR[Main]: .../mods/unified_inventory/register.lua:332: in function 'get_formspec'
 ERROR[Main]: .../mods/unified_inventory/internal.lua:309: in function 'get_formspec'
 ERROR[Main]: .../mods/unified_inventory/internal.lua:334: in function 'set_inventory_formspec'
 ERROR[Main]: .../mods/unified_inventory/callbacks.lua:209: in function 'func'
 ERROR[Main]: .../builtin/profiler/instrumentation.lua:124: in function <.../builtin/profiler/instrumentation.lua:117>
 ERROR[Main]: .../builtin/common/register.lua:26: in function <.../builtin/common/register.lua:12>

unknown items should not exist normally, but it's also better to not crash at least :)

@SmallJoker
Copy link
Member

Regression from e071a01 @Emojigit

@SmallJoker SmallJoker merged commit 43cf0d8 into minetest-mods:master Dec 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants