From 6d80199412e79f16e051362646a098cfdc601e0a Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Sun, 3 Jan 2021 16:51:57 +0100 Subject: [PATCH] skip drowning if the armor inventory could not be found --- drowning.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drowning.lua b/drowning.lua index ee46bdb..fdc596b 100644 --- a/drowning.lua +++ b/drowning.lua @@ -1,6 +1,10 @@ local function check_player(player, timer) local _, armor_inv = armor.get_valid_player(armor, player, "[spacesuit]") + if not armor_inv then + -- inventory not found (somehow?), skip check + return + end local has_helmet = armor_inv:contains_item("armor", "spacesuit:helmet") local has_chestplate = armor_inv:contains_item("armor", "spacesuit:chestplate")