From 60971f8b6ba80cf48629fb3b6f4a32a3a44dcd19 Mon Sep 17 00:00:00 2001 From: imanjra Date: Thu, 9 Jan 2025 12:33:02 -0500 Subject: [PATCH] only invoke onUnLoad if defined --- app/packages/operators/src/CustomPanel.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/packages/operators/src/CustomPanel.tsx b/app/packages/operators/src/CustomPanel.tsx index 3674374027..a5b1aafcde 100644 --- a/app/packages/operators/src/CustomPanel.tsx +++ b/app/packages/operators/src/CustomPanel.tsx @@ -38,7 +38,9 @@ export function CustomPanel(props: CustomPanelProps) { setPanelCloseEffect(() => { clearUseKeyStores(panelId); trackEvent("close_panel", { panel: panelName }); - triggerPanelEvent(panelId, { operator: props.onUnLoad }); + if (props.onUnLoad) { + triggerPanelEvent(panelId, { operator: props.onUnLoad }); + } }); }, []);