From 66a64439c6cfd3431c97b87bd66849d67338274e Mon Sep 17 00:00:00 2001 From: kay27 Date: Mon, 22 Mar 2021 17:31:24 +0400 Subject: [PATCH] [mcl_weather] Fix crash on saving uninitialized data, https://git.minetest.land/MineClone2/MineClone2/issues/1361 --- mods/ENVIRONMENT/mcl_weather/weather_core.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ENVIRONMENT/mcl_weather/weather_core.lua b/mods/ENVIRONMENT/mcl_weather/weather_core.lua index 365f6e549..d3772dc7e 100644 --- a/mods/ENVIRONMENT/mcl_weather/weather_core.lua +++ b/mods/ENVIRONMENT/mcl_weather/weather_core.lua @@ -38,6 +38,7 @@ mcl_weather.reg_weathers["none"] = { local storage = minetest.get_mod_storage() -- Save weather into mod storage, so it can be loaded after restarting the server local save_weather = function() + if not mcl_weather.end_time then return end storage:set_string("mcl_weather_state", mcl_weather.state) storage:set_int("mcl_weather_end_time", mcl_weather.end_time) minetest.log("verbose", "[mcl_weather] Weather data saved: state="..mcl_weather.state.." end_time="..mcl_weather.end_time)