From e4602b710d39ea84d7edd4b56608e859ceff14da Mon Sep 17 00:00:00 2001 From: MattMo Date: Sun, 23 Jul 2023 22:05:00 -0700 Subject: [PATCH] Fixed a bug where on a class change we didn't check to see if the element existed. --- ignite-template.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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); + } + }); + } } /**