From d67a94f1db80b2abef450409d0a42602e3300e12 Mon Sep 17 00:00:00 2001 From: Aria Stewart Date: Fri, 18 Oct 2019 10:43:27 -0400 Subject: [PATCH] Avoid an error on double detaching a node --- src/runtime/internal/dom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/dom.ts b/src/runtime/internal/dom.ts index 481fb7d74a..7df8fcf45c 100644 --- a/src/runtime/internal/dom.ts +++ b/src/runtime/internal/dom.ts @@ -7,7 +7,7 @@ export function insert(target: Node, node: Node, anchor?: Node) { } export function detach(node: Node) { - node.parentNode.removeChild(node); + if (node.parentNode) node.parentNode.removeChild(node); } export function destroy_each(iterations, detaching) {