From f9bc895f0a8e8ee7034c34d8e0644539654a0923 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 22 Apr 2023 07:17:48 +0530 Subject: [PATCH] Fix exception when opening book info popup window with no cover and fit cover checkbox checked --- src/calibre/gui2/dialogs/book_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/book_info.py b/src/calibre/gui2/dialogs/book_info.py index ea6f905983..eea83a7d26 100644 --- a/src/calibre/gui2/dialogs/book_info.py +++ b/src/calibre/gui2/dialogs/book_info.py @@ -341,7 +341,7 @@ class BookInfo(QDialog): self.cover.set_marked(self.marked) return pixmap = self.cover_pixmap - if self.fit_cover.isChecked(): + if self.fit_cover.isChecked() and not pixmap.isNull(): scaled, new_width, new_height = fit_image(pixmap.width(), pixmap.height(), self.cover.size().width()-10, self.cover.size().height()-10)