Return a null pixmap rather than failing

This commit is contained in:
Kovid Goyal 2022-07-14 23:04:13 +05:30
parent 06432e4eee
commit 9cd8e43040
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1305,8 +1305,7 @@ class Application(QApplication):
@lru_cache(maxsize=256)
def cached_qpixmap(self, name):
ic = QIcon.ic(name)
pmap = ic.pixmap(ic.availableSizes()[0])
return pmap
return ic.pixmap((ic.availableSizes() or (256,))[0])
def on_palette_change(self):
self.cached_qimage.cache_clear()