Fix default mod nil check

This fixes the error that occurs when info is not returned on occasion, so info.formspec_version is not available and crashes servers.
This commit is contained in:
tenplus1 2020-07-13 15:13:22 +01:00 committed by GitHub
parent 8c01a5b288
commit cb968e29c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ minetest.register_on_joinplayer(function(player)
listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] ]]
local name = player:get_player_name()
local info = minetest.get_player_information(name)
if info.formspec_version > 1 then
if info and info.formspec_version > 1 then
formspec = formspec .. "background9[5,5;1,1;gui_formbg.png;true;10]"
else
formspec = formspec .. "background[5,5;1,1;gui_formbg.png;true]"