From 6ef17fed27be4d26998913f76f6e1347f149656e Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 17 Oct 2024 02:25:31 +0100 Subject: [PATCH] core/notify: fix crash in suppression system `local globalstate` is initialised to have the field `suppressed_players`, but the non-existent field `suppress` is requested, resulting in operations on nil rather than the expected table. This causes the aforementioned crash. This commit fixes this issue. --- worldeditadditions_core/utils/notify/notify.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worldeditadditions_core/utils/notify/notify.lua b/worldeditadditions_core/utils/notify/notify.lua index f844240..6d63024 100644 --- a/worldeditadditions_core/utils/notify/notify.lua +++ b/worldeditadditions_core/utils/notify/notify.lua @@ -137,7 +137,7 @@ end -- @param number > 1 time The number of seconds to suppress notifications for. -- number < 1 immediately removes the suppression. function Notify.suppress_for_player(name, time) - local suppress = globalstate.suppress + local suppress = globalstate.suppressed_players -- If the player is already suppressed, cancel it unless it's a function if not check_clear_suppressed(name, suppress) then return false end if time < 1 then return end @@ -149,7 +149,7 @@ end --- Suppress a player's notifications while function executes. function Notify.suppress_for_function(name, func) - local suppress = globalstate.suppress + local suppress = globalstate.suppressed_players -- If the player is already suppressed, cancel it unless it's a function if not check_clear_suppressed(name, suppress) then return false end suppress[name] = func