From b420bd8b2015af971a301e2800755353de304e6c Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 15 Feb 2024 11:22:49 +0100 Subject: [PATCH] Access `PDFViewerApplication.findBar` safely in more spots (PR 15831 follow-up) Note that this patch is the result of code-inspection, and the code as written doesn't (currently) cause any bugs in e.g. the GeckoView PDF Viewer. --- web/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index 64e3e86c2d0a9..4e77cd5019441 100644 --- a/web/app.js +++ b/web/app.js @@ -2286,7 +2286,7 @@ function webViewerNamedAction(evt) { case "Find": if (!PDFViewerApplication.supportsIntegratedFind) { - PDFViewerApplication?.findBar.toggle(); + PDFViewerApplication.findBar?.toggle(); } break; @@ -2517,7 +2517,7 @@ function webViewerUpdateFindMatchesCount({ matchesCount }) { if (PDFViewerApplication.supportsIntegratedFind) { PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount); } else { - PDFViewerApplication.findBar.updateResultsCount(matchesCount); + PDFViewerApplication.findBar?.updateResultsCount(matchesCount); } }