فهرست منبع

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);