Skip to content

Commit

Permalink
[fix] check parentNode exists before removing child (#6910)
Browse files Browse the repository at this point in the history
Fixes #6037
  • Loading branch information
byt3rr authored Nov 7, 2022
1 parent d39920f commit 84ea242
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/runtime/internal/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ export function insert_hydration(target: NodeEx, node: NodeEx, anchor?: NodeEx)
}

export function detach(node: Node) {
node.parentNode.removeChild(node);
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}

export function destroy_each(iterations, detaching) {
Expand Down

0 comments on commit 84ea242

Please sign in to comment.