ソースを参照

make sure teh parent node exists when calling Element#remove

Gildas 7 年 前
コミット
f5026daffc
1 ファイル変更3 行追加1 行削除
  1. 3 1
      lib/single-file/single-file-core.js

+ 3 - 1
lib/single-file/single-file-core.js

@@ -374,7 +374,9 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 		}
 
 		async finalize() {
-			this.workStyleElement.remove();
+			if (this.workStyleElement.parentNode) {
+				this.workStyleElement.remove();
+			}
 			const metaCharset = this.doc.head.querySelector("meta[charset]");
 			if (metaCharset) {
 				this.doc.head.insertBefore(metaCharset, this.doc.head.firstChild);