MrRar / edit_skin

Advanced skin editor mod for Minetest
MIT License
7 stars 5 forks source link

crash at login #1

Closed Niklp09 closed 2 years ago

Niklp09 commented 2 years ago

my server crashes when a player wants to close the client window during joining

2022-08-31 13:32:21: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod '' in callback environment_Step(): /home/nik/minetest/bin/../mods/edit_skin/init.lua:101: attempt to index local 'skin' (a nil value)
2022-08-31 13:32:21: ERROR[Main]: stack traceback:
2022-08-31 13:32:21: ERROR[Main]:   /home/nik/minetest/bin/../mods/edit_skin/init.lua:101: in function 'compile_skin'
2022-08-31 13:32:21: ERROR[Main]:   /home/nik/minetest/bin/../mods/edit_skin/init.lua:123: in function 'update_player_skin'
2022-08-31 13:32:21: ERROR[Main]:   /home/nik/minetest/bin/../mods/edit_skin/init.lua:172: in function 'func'
2022-08-31 13:32:21: ERROR[Main]:   /home/nik/minetest/bin/../builtin/common/after.lua:20: in function </home/nik/minetest/bin/../builtin/common/after.lua:5>
2022-08-31 13:32:21: ERROR[Main]:   /home/nik/minetest/bin/../builtin/game/register.lua:431: in function </home/nik/minetest/bin/../builtin/game/register.lua:417>
MrRar commented 2 years ago

Are you using 3D armor?

Line 170 and following:

     -- Needed for 3D Armor + sfinv
    if minetest.global_exists("armor") then
        minetest.after(0.01, function() edit_skin.update_player_skin(player) end)
    end

This code is missing an ObjectRef validity check.

Niklp09 commented 2 years ago

Yes, i'm using 3d_armor

MrRar commented 2 years ago

Please try it again. I think I have resolved this issue. I was able to reproduce the crash. After fixing the issue, I can't reproduce the crash.

Niklp09 commented 2 years ago

yeah it works! thank you for the quick response