Sfoglia il codice sorgente

prevent error when processing a SVG node

Gildas 7 anni fa
parent
commit
416bb87dd8
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      lib/single-file/css-rules-matcher.js

+ 1 - 1
lib/single-file/css-rules-matcher.js

@@ -131,7 +131,7 @@ this.RulesMatcher = this.RulesMatcher || (() => {
 		if (!elementInfo) {
 			elementInfo = [];
 			const elementStyle = element.style;
-			if (elementStyle.length) {
+			if (elementStyle && elementStyle.length) {
 				elementInfo.push({ cssStyle: elementStyle });
 			}
 			mediaInfo.elements.set(element, elementInfo);