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 8667b89 commit e306692
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/elements/dom-if.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ export class DomIf extends PolymerElement {
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 e306692

Please sign in to comment.