Don't traceback on unknown image formats
This commit is contained in:
parent
0064e6c3ff
commit
71b0e7c3a9
@ -26,16 +26,21 @@ class BuddyMenu(Menu):
|
|||||||
buddy_object = self._buddy.get_buddy()
|
buddy_object = self._buddy.get_buddy()
|
||||||
if not buddy_object:
|
if not buddy_object:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
pixbuf = None
|
||||||
icon_data = buddy_object.get_icon()
|
icon_data = buddy_object.get_icon()
|
||||||
icon_data_string = ""
|
icon_data_string = ""
|
||||||
for item in icon_data:
|
for item in icon_data:
|
||||||
if item < 0:
|
if item < 0:
|
||||||
item = item + 128
|
item = item + 128
|
||||||
icon_data_string = icon_data_string + chr(item)
|
icon_data_string += chr(item)
|
||||||
pbl = gtk.gdk.PixbufLoader()
|
pbl = gtk.gdk.PixbufLoader()
|
||||||
pbl.write(icon_data_string)
|
pbl.write(icon_data_string)
|
||||||
pbl.close()
|
try:
|
||||||
pixbuf = pbl.get_pixbuf()
|
pbl.close()
|
||||||
|
pixbuf = pbl.get_pixbuf()
|
||||||
|
except gobject.GError:
|
||||||
|
pass
|
||||||
del pbl
|
del pbl
|
||||||
return pixbuf
|
return pixbuf
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user