Skip to content

Commit

Permalink
recent-view: Verify a path exists before adding an icon
Browse files Browse the repository at this point in the history
Fixes warnings when switching from the recent view to
a document back and forth.
  • Loading branch information
Germán Poo-Caamaño authored and Carlos Garcia Campos committed May 10, 2014
1 parent 48ef495 commit ecadc01
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions shell/ev-recent-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit ecadc01

Please sign in to comment.