Pārlūkot izejas kodu

added try/catch

Gildas 7 gadi atpakaļ
vecāks
revīzija
e05e43f745
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5 1
      lib/single-file/doc-helper.js

+ 5 - 1
lib/single-file/doc-helper.js

@@ -128,7 +128,11 @@ this.docHelper = this.docHelper || (() => {
 					/* ignored */
 				}
 				if (!stylesheet || stylesheet.cssRules.length != styleElement.sheet.cssRules.length) {
-					contents[styleIndex] = Array.from(styleElement.sheet.cssRules).map(rule => rule.cssText).join("\n");
+					try {
+						contents[styleIndex] = Array.from(styleElement.sheet.cssRules).map(rule => rule.cssText).join("\n");
+					} catch (error) {
+						/* ignored */
+					}
 				}
 			});
 			return contents;