From: Nickolay V. Shmyrev Date: Sun, 28 Jan 2007 20:52:01 +0000 (+0000) Subject: Check if document have links model X-Git-Tag: EVINCE_0_7_2~55 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=79c7d48b7ac6b6549bcb91aa6a310ecf6d3d54e3;p=evince.git Check if document have links model svn path=/trunk/; revision=2266 --- diff --git a/shell/ev-window.c b/shell/ev-window.c index 2094b868..325d9164 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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)