Fix exception when opening book info popup window with no cover and fit cover checkbox checked

This commit is contained in:
Kovid Goyal 2023-04-22 07:17:48 +05:30
parent 3ac4dc6e43
commit f9bc895f0a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)