]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-sidebar-thumbnails.c
Check pointer != NULL before using it. Fixes bug #416841.
[evince.git] / shell / ev-sidebar-thumbnails.c
index 325c1633ee147351ca95b2bf9b8b6286f47a7ebe..75b735d1b877d8cca75bb5b000f19ae63b6a355c 100644 (file)
@@ -354,14 +354,11 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails)
                return;
        }
 
-       if (path == NULL)
-               path = gtk_tree_path_new_first ();
-       if (path2 == NULL)
-               path2 = gtk_tree_path_new_from_indices (priv->n_pages,
-                                                       -1);
-       update_visible_range (sidebar_thumbnails,
-                             gtk_tree_path_get_indices (path)[0],
-                             gtk_tree_path_get_indices (path2)[0]);
+       if (path && path2) {
+               update_visible_range (sidebar_thumbnails,
+                                     gtk_tree_path_get_indices (path)[0],
+                                     gtk_tree_path_get_indices (path2)[0]);
+       }
 
        gtk_tree_path_free (path);
        gtk_tree_path_free (path2);