diff --git a/web/app.js b/web/app.js index 676bef930..44e7b99f7 100644 --- a/web/app.js +++ b/web/app.js @@ -759,6 +759,10 @@ let PDFViewerApplication = { return loadingTask.promise.then((pdfDocument) => { this.load(pdfDocument); }, (exception) => { + if (loadingTask !== this.pdfLoadingTask) { + return; // Ignore errors for previously opened PDF files. + } + let message = exception && exception.message; let loadingErrorMessage; if (exception instanceof InvalidPDFException) {