diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index ccf215210c..4182897ee0 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -313,6 +313,8 @@ class EbookViewer(MainWindow, Ui_EbookViewer): self.view.goto_bookmark(m) else: self.pending_bookmark = bm + if spine_index < 0 or spine_index >= len(self.iterator.spine): + spine_index = 0 self.load_path(self.iterator.spine[spine_index]) def toc_clicked(self, index):