1
0
Gildas 7 жил өмнө
parent
commit
1b5d1155d8

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

@@ -62,7 +62,7 @@ this.docHelper = this.docHelper || (() => {
 		if (win) {
 			canvasData = getCanvasData(doc, win);
 			imageData = getImageData(doc, win, options);
-			if (options.removeHiddenElements || options.removeUnusedStyles || options.compressHTML) {
+			if (doc.body && (options.removeHiddenElements || options.removeUnusedStyles || options.compressHTML)) {
 				let elementsInfo = getElementsInfo(win, doc.body);
 				if (options.removeHiddenElements) {
 					const markerRemovedContent = removedContentAttributeName(options.sessionId);