kgtk: do not log if printer icon missing

This commit is contained in:
alfrix 2024-04-30 07:26:12 -03:00
parent 81560ca006
commit 032760e118

View File

@ -122,7 +122,8 @@ class KlippyGtk:
height = height if height is not None else self.img_height
filename = os.path.join(self.themedir, filename)
for ext in ["svg", "png"]:
pixbuf = self.PixbufFromFile(f"{filename}.{ext}", int(width), int(height))
file = f"{filename}.{ext}"
pixbuf = self.PixbufFromFile(file, int(width), int(height)) if os.path.exists(file) else None
if pixbuf is not None:
return pixbuf
return None