From 4f708c599dd8f6ce09ba866eb741fc61f1ec9e4a Mon Sep 17 00:00:00 2001 From: jul-lam Date: Wed, 6 Dec 2023 15:15:20 +0100 Subject: [PATCH] fix: disconnectedCallback causing npe --- packages/core/src/components/utils/listener.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/components/utils/listener.ts b/packages/core/src/components/utils/listener.ts index 892854ad408..562750d3473 100644 --- a/packages/core/src/components/utils/listener.ts +++ b/packages/core/src/components/utils/listener.ts @@ -83,7 +83,7 @@ export function OnListener(event: string, fnExp?: (self: T) => boolean) { proto.disconnectedCallback = function () { const host = getElement(this); - host[`__ix__${methodName}`].destroy(); + host[`__ix__${methodName}`]?.destroy(); host[`__ix__${methodName}`] = null; return disconnectedCallback && disconnectedCallback.call(this); };