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