mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-07 03:44:07 +03:00
fix(core): check if listener.handler is undefined (#10007)
This commit is contained in:
parent
c98f385cb5
commit
4ca297b35b
@ -231,7 +231,7 @@ pub fn event_initialization_script(function: &str, listeners: &str) -> String {
|
|||||||
const listeners = (window['{listeners}'] && window['{listeners}'][eventData.event]) || []
|
const listeners = (window['{listeners}'] && window['{listeners}'][eventData.event]) || []
|
||||||
for (const id of ids) {{
|
for (const id of ids) {{
|
||||||
const listener = listeners[id]
|
const listener = listeners[id]
|
||||||
if (listener) {{
|
if (listener && listener.handler) {{
|
||||||
eventData.id = id
|
eventData.id = id
|
||||||
listener.handler(eventData)
|
listener.handler(eventData)
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user