summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
Diffstat (limited to 'libview')
-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 e1b060cc..5fbf12ff 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -5232,12 +5232,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;
+
view->loading = FALSE;
- g_object_ref (view->document);
setup_caches (view);
}