From 2edeafb97b40f643e559bd347b9846d98eb09f63 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 16 May 2018 19:36:30 +0200 Subject: Minimal: Fix HP change crash (#7344) --- games/minimal/mods/test/init.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'games/minimal/mods') diff --git a/games/minimal/mods/test/init.lua b/games/minimal/mods/test/init.lua index 3141b4cf3..4806ba4fc 100644 --- a/games/minimal/mods/test/init.lua +++ b/games/minimal/mods/test/init.lua @@ -27,6 +27,10 @@ local function run_hpchangereason_tests(player) assert(expect == nil) end minetest.register_on_player_hpchange(function(player, hp, reason) + if not expect then + return + end + for key, value in pairs(reason) do assert(expect[key] == value) end -- cgit v1.2.3