]> www.fi.muni.cz Git - evince.git/commitdiff
Check if document have links model
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 28 Jan 2007 20:52:01 +0000 (20:52 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 28 Jan 2007 20:52:01 +0000 (20:52 +0000)
svn path=/trunk/; revision=2266

shell/ev-window.c

index 2094b868757d94abf6ee3e4061b52ce5233b6d98..325d91649e43658a30de2f247eb8ceb6e2e5c5e2 100644 (file)
@@ -705,16 +705,20 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link)
        find_task.page_label = page_label;
        find_task.chapter = NULL;
        
-       if (EV_IS_DOCUMENT_LINKS (window->priv->document)) {
+       if (EV_IS_DOCUMENT_LINKS (window->priv->document) && 
+           ev_document_links_has_document_links (EV_DOCUMENT_LINKS (window->priv->document))) {
                GtkTreeModel *model;
        
                g_object_get (G_OBJECT (window->priv->sidebar_links), "model", &model, NULL);
                
-               gtk_tree_model_foreach (model,
-                                       ev_window_find_chapter,
-                                       &find_task);
+               if (model) {
+               
+                       gtk_tree_model_foreach (model,
+                                               ev_window_find_chapter,
+                                               &find_task);
        
-               g_object_unref (model);
+                       g_object_unref (model);
+               }
        }
 
        if (find_task.chapter)