From 4ca297b35b72acf85cecc504c6626c65c1c261bc Mon Sep 17 00:00:00 2001 From: Yasunari Fujieda Date: Thu, 13 Jun 2024 01:32:06 +0900 Subject: [PATCH] fix(core): check if listener.handler is undefined (#10007) --- core/tauri/src/event/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tauri/src/event/mod.rs b/core/tauri/src/event/mod.rs index 3e2fd207c..2086a7d62 100644 --- a/core/tauri/src/event/mod.rs +++ b/core/tauri/src/event/mod.rs @@ -231,7 +231,7 @@ pub fn event_initialization_script(function: &str, listeners: &str) -> String { const listeners = (window['{listeners}'] && window['{listeners}'][eventData.event]) || [] for (const id of ids) {{ const listener = listeners[id] - if (listener) {{ + if (listener && listener.handler) {{ eventData.id = id listener.handler(eventData) }}