assert that player is not fake player to broadcast

This commit is contained in:
Freeman 2024-10-13 12:43:48 +02:00
parent 1263a9fee3
commit 05dfef5153

@ -22,7 +22,9 @@
local S = core.get_translator(core.get_current_modname()) local S = core.get_translator(core.get_current_modname())
function emeraldbank.broadcast(player, msg, color, timeout) function emeraldbank.broadcast(player, msg, color, timeout)
if not player:is_player() then return end if not (player and type(player) ~= "string" and player:is_player()) then
return
end
local name = player:get_player_name() local name = player:get_player_name()
if core.get_modpath("notifications_wrapper") then if core.get_modpath("notifications_wrapper") then
notifications.queue({ notifications.queue({