minetest-mods / edit

This mod allows you to copy, paste, fill and delete 3D areas.
Other
4 stars 8 forks source link

Server Crash #3

Open Andarius68 opened 5 months ago

Andarius68 commented 5 months ago

I just had this in my log file following a server crash and interestingly enough I wasn't using the edit mod for anything at the time. I had used it earlier in the day though. About an hour prior. But at this time I was simply breaking a mossy cobblestone block and using the replacer mod by Sokomine to place some of those onto a recent build.

2024-06-03 14:11:42: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'edit' in callback environment_Step(): ...erver/5.9-dev-main/minetest/bin/../mods/edit/preview.lua:284: bad argument #1 to 'pairs' (value expected)
2024-06-03 14:11:42: ERROR[Main]: stack traceback:
2024-06-03 14:11:42: ERROR[Main]:   [C]: in function 'pairs'
2024-06-03 14:11:42: ERROR[Main]:   ...erver/5.9-dev-main/minetest/bin/../mods/edit/preview.lua:284: in function 'hide_paste_preview'
2024-06-03 14:11:42: ERROR[Main]:   ...erver/5.9-dev-main/minetest/bin/../mods/edit/preview.lua:474: in function 'globalstep'
2024-06-03 14:11:42: ERROR[Main]:   ...n/minetest/bin/../mods/monitoring/builtin/globalstep.lua:73: in function <...n/minetest/bin/../mods/monitoring/builtin/globalstep.lua:55>
2024-06-03 14:11:42: ERROR[Main]:   ...5.9-dev-main/minetest/bin/../builtin/common/register.lua:26: in function <...5.9-dev-main/minetest/bin/../builtin/common/register.lua:12>
SmallJoker commented 1 month ago

https://github.com/minetest-mods/edit/blob/2eb1728d8beebff43c9f5c164f2cb681405c81b1/preview.lua#L278-L290

get_children() may return no value if the entity d.paste_preview.object is already gone/removed from the world.

I do yet not know how this mod works, or what it is supposed to to. Leaving it here in case someone would like to fix it. Possible minimalistic fix: (needs testing for visibility side-effects or follow-up errors)

for _, objref in pairs(d.paste_preview.object:get_children() or {}) do