]> git.0d.be Git - empathy.git/commitdiff
fixed libnotify crashing if icon doesn't exist
authorAbderaouf Bencherait <kenshin@collabora.co.uk>
Fri, 26 Jun 2009 23:38:37 +0000 (19:38 -0400)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 30 Jun 2009 09:15:49 +0000 (10:15 +0100)
src/empathy-chat-window.c
src/empathy-status-icon.c

index 424d148ac1ce6aca564157b90c6552f5e22da044..8e317f603029eaff735fedb0cd1ceb1a6547f4f9 100644 (file)
@@ -974,11 +974,15 @@ chat_window_show_or_update_notification (EmpathyChatWindow *window,
        if (priv->notification != NULL) {
                notify_notification_update (priv->notification,
                                            header, escaped, NULL);
-               notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
+               /* if icon doesn't exist libnotify will crash */
+               if (pixbuf != NULL)
+                       notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
        } else {
                priv->notification = notify_notification_new (header, escaped, NULL, NULL);
                notify_notification_set_timeout (priv->notification, NOTIFY_EXPIRES_DEFAULT);
-               notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
+               /* if icon doesn't exist libnotify will crash */
+               if (pixbuf != NULL)
+                       notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf);
 
                g_signal_connect (priv->notification, "closed",
                                  G_CALLBACK (chat_window_notification_closed_cb), cb_data);
index d6520ff7cf1aa5eecd29c8151ac2fd0051be3fda..a4b01b7c0e137a27ab94c9f3b4f2fa2099bb9377 100644 (file)
@@ -153,7 +153,9 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
                                          G_CALLBACK (status_icon_notification_closed_cb), icon);
 
                }
-               notify_notification_set_icon_from_pixbuf (priv->notification,
+               /* if icon doesn't exist libnotify will crash */
+               if (pixbuf != NULL)
+                       notify_notification_set_icon_from_pixbuf (priv->notification,
                                                          pixbuf);
                notify_notification_show (priv->notification, NULL);