From 474659be8b041bb33f9529a391faa1b99e01bc97 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 9 Aug 2021 13:16:02 +0200 Subject: [PATCH] Fix the inconsistent return types in `PDFViewerApplication._parseHashParameters` While not really relevant to the previous patches, this fixes a small inconsistency in the code. --- web/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/app.js b/web/app.js index f18da369e..060af045a 100644 --- a/web/app.js +++ b/web/app.js @@ -323,11 +323,11 @@ const PDFViewerApplication = { */ async _parseHashParameters() { if (!AppOptions.get("pdfBugEnabled")) { - return undefined; + return; } const hash = document.location.hash.substring(1); if (!hash) { - return undefined; + return; } const params = parseQueryString(hash), waitOn = []; @@ -389,11 +389,13 @@ const PDFViewerApplication = { } if (waitOn.length === 0) { - return undefined; + return; } - return Promise.all(waitOn).catch(reason => { + try { + await Promise.all(waitOn); + } catch (reason) { console.error(`_parseHashParameters: "${reason.message}".`); - }); + } }, /**