From 71f8680d665a99bd455ffd3c7190c7a7f55b1060 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 12 Sep 2022 13:32:59 +0200 Subject: [PATCH] Don't try to update the cursorTool when switching to PresentationMode failed Currently this may print an Error message in the console, and while nothing breaks (since no actual Error is thrown) we should probably avoid this. --- web/pdf_cursor_tools.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/pdf_cursor_tools.js b/web/pdf_cursor_tools.js index b2a2ab2ba..e70ba1367 100644 --- a/web/pdf_cursor_tools.js +++ b/web/pdf_cursor_tools.js @@ -133,8 +133,10 @@ class PDFCursorTools { case PresentationModeState.NORMAL: { const previouslyActive = this.activeBeforePresentationMode; - this.activeBeforePresentationMode = null; - this.switchTool(previouslyActive); + if (previouslyActive !== null) { + this.activeBeforePresentationMode = null; + this.switchTool(previouslyActive); + } break; } }