Don't show contact if it's null
authorArtem Garmash <artemgarmash@gmail.com>
Thu, 11 Feb 2010 22:48:02 +0000 (00:48 +0200)
committerArtem Garmash <artem.garmash@nokia.com>
Sun, 27 Jun 2010 19:13:47 +0000 (22:13 +0300)
src/el-home-applet.c

index 69185e3..7991a94 100644 (file)
@@ -648,6 +648,8 @@ show_contact (ELHomeApplet *self)
 {
         ELHomeAppletPrivate *priv = self->priv;
 
+        g_return_if_fail (priv->contact);
+
         gtk_label_set_text (GTK_LABEL (priv->sender),
                             osso_abook_contact_get_display_name (priv->contact));
         resize_sender (priv);
@@ -1210,11 +1212,13 @@ read_event (ELHomeApplet *self)
         if (priv->event_id >= 0) {
                 gboolean new_account = g_strcmp0 (priv->local_id, local_id);
 
-                if (g_strcmp0 (priv->remote_id, remote_id) || new_account) {
+                if (g_strcmp0 (priv->remote_id, remote_id) ||
+                    new_account ||
+                    !priv->contact) {
                         clean_contact (self);
                         start_aggregator (self);
                 }
-                else {
+                else if (priv->contact) {
                         show_contact (self);
                 }