From 11c8e33ed1337558bd34d0055a38554f905695d4 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 10 Sep 2018 16:02:44 +0200 Subject: [PATCH] [Regression] Ensure that `PDFFindBar.updateResultsCount` doesn't throw when the viewer is closed, by providing proper default values The error can be reproduced by opening any file in the viewer, and then running `PDFViewerApplication.close()` in the console. --- web/pdf_find_bar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pdf_find_bar.js b/web/pdf_find_bar.js index a4e9d8ef1..325f8be10 100644 --- a/web/pdf_find_bar.js +++ b/web/pdf_find_bar.js @@ -153,7 +153,7 @@ class PDFFindBar { this.updateResultsCount(matchesCount); } - updateResultsCount({ current, total, }) { + updateResultsCount({ current = 0, total = 0, } = {}) { if (!this.findResultsCount) { return; // No UI control is provided. }