summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libview/ev-view.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index a2f368d8..8c7c8520 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -6769,12 +6769,15 @@ ev_view_document_changed_cb (EvDocumentModel *model,
g_object_unref (view->document);
}
- view->document = document;
+ view->document = document ? g_object_ref (document) : NULL;
view->find_result = 0;
if (view->document) {
+ if (ev_document_get_n_pages (view->document) <= 0 ||
+ !ev_document_check_dimensions (view->document))
+ return;
+
ev_view_set_loading (view, FALSE);
- g_object_ref (view->document);
setup_caches (view);
}