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)