Fix for a crash in view_msg_cb if row_reference was NULL.
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 24 Jul 2009 14:39:53 +0000 (16:39 +0200)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 24 Jul 2009 14:39:53 +0000 (16:39 +0200)
* src/hildon2/modest-msg-view-window.c (view_msg_cb): fix a crash that
  happened when we used view_msg_cb and there was no row_reference as
  parameter (fixes NB#129121).

src/hildon2/modest-msg-view-window.c

index feb88c3..d141571 100644 (file)
@@ -2180,12 +2180,16 @@ view_msg_cb (ModestMailOperation *mail_op,
        /* Update the row reference */
        if (priv->row_reference != NULL) {
                gtk_tree_row_reference_free (priv->row_reference);
-               priv->row_reference = gtk_tree_row_reference_copy (row_reference);
+               priv->row_reference = row_reference?gtk_tree_row_reference_copy (row_reference):NULL;
                if (priv->next_row_reference != NULL) {
                        gtk_tree_row_reference_free (priv->next_row_reference);
                }
-               priv->next_row_reference = gtk_tree_row_reference_copy (priv->row_reference);
-               select_next_valid_row (priv->header_model, &(priv->next_row_reference), TRUE, priv->is_outbox);
+               if (row_reference) {
+                       priv->next_row_reference = gtk_tree_row_reference_copy (priv->row_reference);
+                       select_next_valid_row (priv->header_model, &(priv->next_row_reference), TRUE, priv->is_outbox);
+               } else {
+                       priv->next_row_reference = NULL;
+               }
        }
 
        /* Mark header as read */