Explorar el Código

ensure body is defined

Gildas hace 7 años
padre
commit
1b5d1155d8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/single-file/doc-helper.js

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