Skip to content

Concatenation Error: With nil upvalue 'did' in youngtrees mod (init.lua:139) #71

Description

@Mopishboat

Error message.

AsyncErr: Lua: Runtime error from mod 'youngtrees' in callback environment_OnGenerated(): ...-win64\bin\..\mods\plantlife_modpack\youngtrees\init.lua:139: attempt to concatenate upvalue 'did' (a nil value)
stack traceback:
	...-win64\bin\..\mods\plantlife_modpack\youngtrees\init.lua:139: in function <...-win64\bin\..\mods\plantlife_modpack\youngtrees\init.lua:135>
	...\minetest-5.8.0-win64\bin\..\builtin\common\register.lua:26: in function <...\minetest-5.8.0-win64\bin\..\builtin\common\register.lua:12>

(recommendations from Google Gemini. not my words)

  • Investigate upvalue 'did': Check why the did upvalue is nil at line 139 of init.lua. This might involve reviewing the code around that line or the logic within the environment_OnGenerated() callback function.
  • Handle nil value: If did is intended to be assigned a value earlier but might sometimes be nil, consider adding code to handle the case where it's nil before concatenation. This could involve checking for nil and using a default value or skipping the operation entirely.
  • Review callback logic: Ensure the environment_OnGenerated() callback function is providing the expected values to the code at line 139. If there's a mismatch, the developers might need to adjust the callback or the code using did.
  • Provide documentation: If did is an important variable, consider adding comments in the code to explain its purpose and how it's expected to be used. This can help future developers understand the logic and avoid similar issues.

Additional Information:
Minetest version: 5.8.0
Operating System: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions