Preempt possible crash on nil in on_joinplayer.

* In mineclone5 a crash was reported to occur when deserialization of
  storage returned nil in on_joinplayer.    https://git.minetest.land/
  MineClone5/MineClone5/commit/96c4fb60d8641b4181edb902ed24dbf173828d09
  This commit uses a different, but equally effective fix.
This commit is contained in:
kabou 2022-03-03 10:14:35 +01:00 committed by cora
parent e9ff2ba32a
commit 90311da514
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ minetest.register_on_joinplayer(function(player)
local storage = {} local storage = {}
local burn_data = player:get_meta():get_string("mcl_burning:data") local burn_data = player:get_meta():get_string("mcl_burning:data")
if burn_data ~= "" then if burn_data ~= "" then
storage = minetest.deserialize(burn_data) storage = minetest.deserialize(burn_data) or storage
end end
mcl_burning.storage[player] = storage mcl_burning.storage[player] = storage
if storage.burn_time and storage.burn_time > 0 then if storage.burn_time and storage.burn_time > 0 then