From efc5beadd7f3f729e4a4461e8ec97c3aee3c4f6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 22 Aug 2019 22:46:45 +0200 Subject: [PATCH] Do not log as error empty icon name issue8584 review257981002 --- tryton/common/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tryton/common/common.py b/tryton/common/common.py index 8ebcd1948d..0e0aeb33b6 100644 --- a/tryton/common/common.py +++ b/tryton/common/common.py @@ -113,6 +113,8 @@ class IconFactory: @classmethod def get_pixbuf(cls, iconname, size=16, color=None, badge=None): + if not iconname: + return colors = CONFIG['icon.colors'].split(',') cls.register_icon(iconname) if iconname not in cls._pixbufs[(size, badge)]: @@ -160,9 +162,10 @@ class IconFactory: @classmethod def get_image(cls, iconname, size=16, color=None, badge=None): - pixbuf = cls.get_pixbuf(iconname, size, color, badge) image = Gtk.Image() - image.set_from_pixbuf(pixbuf) + if iconname: + pixbuf = cls.get_pixbuf(iconname, size, color, badge) + image.set_from_pixbuf(pixbuf) return image