Fixes leak 25/26
authorSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:30:58 +0000 (19:30 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:30:58 +0000 (19:30 +0000)
pmo-trunk-r8126

src/widgets/modest-attachments-view.c

index 5e21279..5617a65 100644 (file)
@@ -243,14 +243,14 @@ modest_attachments_view_remove_attachment (ModestAttachmentsView *atts_view, Tny
 
                box_children = gtk_container_get_children (GTK_CONTAINER (priv->box));
                node = g_list_find (box_children, found_att_view);
 
                box_children = gtk_container_get_children (GTK_CONTAINER (priv->box));
                node = g_list_find (box_children, found_att_view);
-               if (node->next)
+               if (node && node->next)
                        next_widget = node->next->data;
 
                g_list_free (box_children);
                gtk_widget_destroy (GTK_WIDGET (found_att_view));
 
                node = g_list_find (priv->selected, found_att_view);
                        next_widget = node->next->data;
 
                g_list_free (box_children);
                gtk_widget_destroy (GTK_WIDGET (found_att_view));
 
                node = g_list_find (priv->selected, found_att_view);
-               if (node != NULL) {
+               if (node) {
                        priv->selected = g_list_delete_link (priv->selected, node);
                        if ((priv->selected == NULL) && (next_widget != NULL))
                                set_selected (MODEST_ATTACHMENTS_VIEW (atts_view), 
                        priv->selected = g_list_delete_link (priv->selected, node);
                        if ((priv->selected == NULL) && (next_widget != NULL))
                                set_selected (MODEST_ATTACHMENTS_VIEW (atts_view),