Skip to content

Commit

Permalink
Fix latent (benign) error thrown when removing dom-if via innerHTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Jul 18, 2018
1 parent a6331a2 commit 9a75976
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/elements/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,10 @@
if (c$ && c$.length) {
// use first child parent, for case when dom-if may have been detached
let parent = c$[0].parentNode;
for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) {
parent.removeChild(n);
if (parent) {
for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) {
parent.removeChild(n);
}
}
}
this.__instance = null;
Expand Down

0 comments on commit 9a75976

Please sign in to comment.