diff --git a/ignite-template.js b/ignite-template.js index c09e0c0..9b0874f 100644 --- a/ignite-template.js +++ b/ignite-template.js @@ -1378,11 +1378,13 @@ class IgniteTemplate { //For any classes that are missing on the element, add them. If we have duplicates this //can happen. - this._classes.forEach((cl) => { - if (!this.element.classList.contains(cl)) { - this.element.classList.add(cl); - } - }); + if (this.element) { + this._classes.forEach((cl) => { + if (!this.element.classList.contains(cl)) { + this.element.classList.add(cl); + } + }); + } } /**