From b7d71eb7f8333cf2c29219ce3fc97cfb72f5aeb7 Mon Sep 17 00:00:00 2001 From: calixteman Date: Mon, 16 Mar 2026 23:34:54 +0100 Subject: [PATCH] Don't throw when printing with pdfBug enabled It fixes #20847. --- src/display/api.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index 136ac1fe955ef..4c257a2fb358d 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1540,8 +1540,11 @@ class PDFPageProxy { this._pdfBug && globalThis.StepperManager?.enabled ); const shouldRecordOperations = - !this.recordedBBoxes && (recordOperations || recordForDebugger); - const shouldRecordImages = !this.imageCoordinates && recordImages; + !!canvas && + !this.recordedBBoxes && + (recordOperations || recordForDebugger); + const shouldRecordImages = + !!canvas && !this.imageCoordinates && recordImages; const complete = error => { intentState.renderTasks.delete(internalRenderTask);