[evince] recent-view: Verify a path exists before adding an icon



commit ecadc01f25a2e21b162bd4223a5869d3bf1b763d
Author: Germán Poo-Caamaño <gpoo gnome org>
Date:   Thu May 8 00:41:40 2014 -0700

    recent-view: Verify a path exists before adding an icon
    
    Fixes warnings when switching from the recent view to
    a document back and forth.

 shell/ev-recent-view.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/shell/ev-recent-view.c b/shell/ev-recent-view.c
index 4ff0a38..c0aa00a 100644
--- a/shell/ev-recent-view.c
+++ b/shell/ev-recent-view.c
@@ -224,13 +224,17 @@ thumbnail_job_completed_callback (EvJobThumbnail *job,
 
         row = (GtkTreeRowReference *) g_object_get_data (G_OBJECT (job), "row-reference");
         path = gtk_tree_row_reference_get_path (row);
-        gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
-        gtk_tree_path_free (path);
 
-        gtk_list_store_set (priv->model, &iter,
-                            GD_MAIN_COLUMN_ICON, surface,
-                            EV_RECENT_VIEW_JOB_COLUMN, NULL,
-                            -1);
+        if (path != NULL) {
+                gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path);
+                gtk_tree_path_free (path);
+
+                gtk_list_store_set (priv->model, &iter,
+                                    GD_MAIN_COLUMN_ICON, surface,
+                                    EV_RECENT_VIEW_JOB_COLUMN, NULL,
+                                    -1);
+        }
+
         cairo_surface_destroy (surface);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]