From e3d073589bd9581ad333fd5fc2f929980c9115ae Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 27 Mar 2020 12:12:09 -0400 Subject: [PATCH] viewer: handle recently opened list when started without a book When starting ebook-viewer standalone without a book, set_book_path has never been called and there is no pathtoebook attribute yet. In this case, we certainly don't need to compare it to the current book. --- src/calibre/gui2/viewer/toolbars.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/viewer/toolbars.py b/src/calibre/gui2/viewer/toolbars.py index fd2727429d..2456ec3797 100644 --- a/src/calibre/gui2/viewer/toolbars.py +++ b/src/calibre/gui2/viewer/toolbars.py @@ -250,7 +250,7 @@ class ActionsToolBar(ToolBar): path = os.path.abspath(entry['pathtoebook']) except Exception: continue - if path == os.path.abspath(set_book_path.pathtoebook): + if hasattr(set_book_path, 'pathtoebook') and path == os.path.abspath(set_book_path.pathtoebook): continue m.addAction('{}\t {}'.format( elided_text(entry['title'], pos='right', width=250),