Explorar o código

added try/catch

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
e05e43f745
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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;