From 90311da514973e5f6cd0bc05b6d9f549429a93d5 Mon Sep 17 00:00:00 2001 From: kabou Date: Thu, 3 Mar 2022 10:14:35 +0100 Subject: [PATCH] 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. --- mods/ENTITIES/mcl_burning/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 5ffc804a1a..8133a1fe36 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -57,7 +57,7 @@ minetest.register_on_joinplayer(function(player) local storage = {} local burn_data = player:get_meta():get_string("mcl_burning:data") if burn_data ~= "" then - storage = minetest.deserialize(burn_data) + storage = minetest.deserialize(burn_data) or storage end mcl_burning.storage[player] = storage if storage.burn_time and storage.burn_time > 0 then