From fa0e1c66ca7a32c0ad7062f63b46ed25dd82d2ac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 Apr 2019 10:39:25 +0530 Subject: [PATCH] E-book viewer: Fix specifying a non-existen location via --open-at causing viewer to hang --- src/calibre/gui2/viewer/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index bf34014fb3..7d8b9bc6a5 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -1094,7 +1094,9 @@ class EbookViewer(MainWindow): if index.isValid(): target_index = index break - if target_index is not None: + if target_index is None: + self.next_document() + else: if self.resize_in_progress: self.pending_toc_click = target_index else: