From 3e4734283e5bb4115fdca44dc1477902b2f9850e Mon Sep 17 00:00:00 2001 From: Anthony Fang Date: Tue, 18 Aug 2020 00:04:04 -0400 Subject: [PATCH] fix: add null check for element --- ie11CustomProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ie11CustomProperties.js b/ie11CustomProperties.js index d703ffc..bfa99f8 100644 --- a/ie11CustomProperties.js +++ b/ie11CustomProperties.js @@ -544,7 +544,7 @@ if (inheritingKeywords[value] || !register[property] || register[property].inherits) { //let el = this.pseudoElt ? this.computedFor : this.computedFor.parentNode; let el = this.computedFor.parentNode; - while (el.nodeType === 1) { + while (el && el.nodeType === 1) { // without, it affects performance: 1000 els inside 100 parents: 1000ms (instead of 600ms) is it acceptable? // would also remove complexity, because i can remove the ieCP_setters property //if (el.ieCP_setters && el.ieCP_setters[property]) {