From 25a25a07a7b68443791974800dbfc77d223392d6 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 18 Apr 2025 16:26:30 +0500 Subject: fix: set type to nil if type is unknown --- luamods/event.lua | 4 ++++ luamods/notify.lua | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'luamods') diff --git a/luamods/event.lua b/luamods/event.lua index 8639023..7d64c50 100644 --- a/luamods/event.lua +++ b/luamods/event.lua @@ -9,6 +9,10 @@ local function parse_target(value) type = str_to_event_type(parts[2]) } + if event_type_to_str(data.type) ~= parts[2] then + data.type = nil + end + if data.type == nil then return data end diff --git a/luamods/notify.lua b/luamods/notify.lua index 36bcb78..db30ec9 100644 --- a/luamods/notify.lua +++ b/luamods/notify.lua @@ -9,6 +9,10 @@ local function parse_target(value) type = str_to_event_type(parts[2]) } + if event_type_to_str(data.type) ~= parts[2] then + data.type = nil + end + if data.type == nil then return data end -- cgit v1.2.3