From 47b1bcb4d9ad67eed62cb0e68e6570c3540e71f2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 6 Oct 2020 06:07:21 +0530 Subject: [PATCH] Viewer: Fix toolbar show controls button not working when no book is open. Fixes #1898598 [Ebook viewer: unhandled error when clicking "Show viewer controls"](https://bugs.launchpad.net/calibre/+bug/1898598) --- src/pyj/read_book/overlay.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index 39ef494851..635390a756 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -375,7 +375,7 @@ class MainOverlay: # {{{ onclick=def (evt):evt.stopPropagation();, set_css(E.div( # top row - E.div(self.overlay.view.book.metadata.title or _('Unknown'), style='max-width: 90%; text-overflow: ellipsis; font-weight: bold; white-space: nowrap; overflow: hidden'), + E.div(self.overlay.view.book?.metadata?.title or _('Unknown'), style='max-width: 90%; text-overflow: ellipsis; font-weight: bold; white-space: nowrap; overflow: hidden'), E.div(self.date_formatter.format(Date()), id=timer_id(), style='max-width: 9%; white-space: nowrap; overflow: hidden'), ), display='flex', justify_content='space-between', align_items='baseline', font_size='smaller', padding='0.5ex 1ex', border_bottom='solid 1px currentColor'