Raise exception for missing icons

This is a regression from 9dc389cc32

previously we used load_icon() which raises an exception for missing icons

now we use lookup_icon() which does not, and iconinfo can be None now
This commit is contained in:
Philipp Hörist 2017-07-02 15:13:19 +02:00
parent 6d9f82d827
commit 6880fba3b4
1 changed files with 2 additions and 0 deletions

View File

@ -59,6 +59,8 @@ class Color:
def get_icon_pixmap(icon_name, size=16, color=None, quiet=False):
try:
iconinfo = gtk_icon_theme.lookup_icon(icon_name, size, 0)
if not iconinfo:
raise GLib.GError
if color:
pixbuf, was_symbolic = iconinfo.load_symbolic(*color)
return pixbuf