Browse Source

make sure documentElement is defined

Gildas 5 năm trước cách đây
mục cha
commit
eb73f709ac
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/single-file/single-file-helper.js

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

@@ -279,7 +279,7 @@ this.singlefile.lib.helper = this.singlefile.lib.helper || (() => {
 			}
 		}
 		if (element.tagName == "LINK") {
-			if (element.import) {
+			if (element.import && element.import.documentElement) {
 				data.imports.push({ content: serialize(element.import) });
 				element.setAttribute(HTML_IMPORT_ATTRIBUTE_NAME, data.imports.length - 1);
 				data.markedElements.push(element);