From 3c4439c04e37769a7673ff5f515f3d726dcbfc0b Mon Sep 17 00:00:00 2001 From: ekhaled Date: Wed, 26 Sep 2018 13:54:24 +0100 Subject: [PATCH] followup fix to #1653 --- src/compile/render-dom/wrappers/Element/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compile/render-dom/wrappers/Element/index.ts b/src/compile/render-dom/wrappers/Element/index.ts index 160f7572f9..88e991d846 100644 --- a/src/compile/render-dom/wrappers/Element/index.ts +++ b/src/compile/render-dom/wrappers/Element/index.ts @@ -831,7 +831,7 @@ export default class ElementWrapper extends Wrapper { } block.builders.destroy.addLine( - `if (typeof ${name}.destroy === 'function') ${name}.destroy.call(#component);` + `if (${name} && typeof ${name}.destroy === 'function') ${name}.destroy.call(#component);` ); }); }