From 7f20e5dcb7711d0e5b1d03a1f22b18890e76b9b8 Mon Sep 17 00:00:00 2001 From: OgelGames Date: Mon, 21 Nov 2022 02:44:50 +1100 Subject: [PATCH] add fake player check (#86) --- 3d_armor/api.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/3d_armor/api.lua b/3d_armor/api.lua index 2378166..0ca2b6d 100644 --- a/3d_armor/api.lua +++ b/3d_armor/api.lua @@ -933,6 +933,10 @@ armor.get_valid_player = function(self, player, msg) minetest.log("warning", ("3d_armor%s: Player reference is nil"):format(msg)) return end + if type(player) ~= "userdata" then + -- Fake player, fail silently + return + end local name = player:get_player_name() if not name then minetest.log("warning", ("3d_armor%s: Player name is nil"):format(msg))