From 2edeafb97b40f643e559bd347b9846d98eb09f63 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Wed, 16 May 2018 19:36:30 +0200 Subject: [PATCH] Minimal: Fix HP change crash (#7344) --- games/minimal/mods/test/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/games/minimal/mods/test/init.lua b/games/minimal/mods/test/init.lua index 3141b4cf..4806ba4f 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