From ed555e6fb0773bafba339e71696cf4d64d0fff45 Mon Sep 17 00:00:00 2001 From: Wil Wilsman Date: Thu, 19 Nov 2020 10:20:31 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20CSSOM=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes innerText can be undefined which causes this function to error when it should report true. --- packages/dom/src/serialize-cssom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dom/src/serialize-cssom.js b/packages/dom/src/serialize-cssom.js index 2aeea0ca8..45cdefe83 100644 --- a/packages/dom/src/serialize-cssom.js +++ b/packages/dom/src/serialize-cssom.js @@ -2,7 +2,7 @@ function isCSSOM(styleSheet) { // no href, has a rulesheet, and isn't already in the DOM return !styleSheet.href && styleSheet.cssRules && - !styleSheet.ownerNode?.innerText.trim().length; + !styleSheet.ownerNode?.innerText?.trim().length; } // Outputs in-memory CSSOM into their respective DOM nodes.