From 3de7c4337db2b302e0ac56b3e1b3173605f5b3ce Mon Sep 17 00:00:00 2001 From: ANAND Date: Fri, 8 May 2020 11:51:22 +0530 Subject: [PATCH] Fix crash when chatting from terminal chat console --- mods/other/afkkick/init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mods/other/afkkick/init.lua b/mods/other/afkkick/init.lua index 1862cfb..63fadb0 100644 --- a/mods/other/afkkick/init.lua +++ b/mods/other/afkkick/init.lua @@ -29,6 +29,11 @@ minetest.register_on_leaveplayer(function(player) end) minetest.register_on_chat_message(function(playerName, message) + -- Verify that there is a player, and that the player is online + if not playerName or not minetest.get_player_by_name(playerName) then + return + end + players[playerName]["lastAction"] = minetest.get_gametime() end)