From 7ecf98ba95b3ba3e61fa385c6e6c55b29b47bfed Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 22 May 2006 02:32:34 -0400 Subject: [PATCH] Check if the icon exists --- sugar/chat/chat.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sugar/chat/chat.py b/sugar/chat/chat.py index 7663f586..31a4f26e 100755 --- a/sugar/chat/chat.py +++ b/sugar/chat/chat.py @@ -278,15 +278,15 @@ class Chat(activity.Activity): def _insert_buddy(self, buf, nick): buddy = self._group.get_buddy(nick) - print buddy.get_nick_name() - pbl = gtk.gdk.PixbufLoader() - pbl.write(buddy.get_icon()) - pbl.close() - pbuf = pbl.get_pixbuf() + if buddy.get_icon(): + pbl = gtk.gdk.PixbufLoader() + pbl.write(buddy.get_icon()) + pbl.close() + pbuf = pbl.get_pixbuf() - aniter = buf.get_end_iter() - buf.insert_pixbuf(aniter, pbuf) + aniter = buf.get_end_iter() + buf.insert_pixbuf(aniter, pbuf) aniter = buf.get_end_iter() buf.insert(aniter, nick + ": ")