From 6dc91cf89397af134e7ba4dabd49957dcdce6f56 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 10 Jan 2021 17:17:57 +0000 Subject: [PATCH] Fix error due to unchecked JSON parsing --- src/data.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data.lua b/src/data.lua index 27ae5e3..0f2188d 100644 --- a/src/data.lua +++ b/src/data.lua @@ -80,7 +80,8 @@ function awards.load() os.rename(old_save_path, minetest.get_worldpath().."/awards.bk.txt") awards.save() else - __player_data = minetest.parse_json(storage:get_string("player_data")) or {} + local json = storage:get("player_data") + __player_data = json and minetest.parse_json(json) or {} end end