diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 15b8e39c20..3e352fb0e0 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1093,6 +1093,9 @@ class Boss(QObject): def quick_open(self): c = current_container() + if c is None: + return error_dialog(self.gui, _('No open book'), _( + 'No book is currently open. You must first open a book to edit.'), show=True) files = [name for name, mime in c.mime_map.iteritems() if c.exists(name) and syntax_from_mime(name, mime) is not None] d = QuickOpen(files, parent=self.gui) if d.exec_() == d.Accepted and d.selected_result is not None: