Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-sidebar-thumbnails.c
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@yandex.ru>2009-05-03 11:35:39 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@yandex.ru>2009-05-03 11:35:39 (GMT)
commit3fe3051453cad77a2964c96b53caf4e5a432b2fe (patch)
tree9f7eb2f27446ab3db589fc4f11e00789722921bb /shell/ev-sidebar-thumbnails.c
parentab20ff2e5e9e3f41be38269fd1023fad8fdc57fe (diff)
[document] Fixes handling of broken documents
Instead of aborting on assertion, we gracefully report that document is broken. Fixes GNOME bug #580886.
Diffstat (limited to 'shell/ev-sidebar-thumbnails.c')
-rw-r--r--shell/ev-sidebar-thumbnails.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index 08be12b..d86e6a5 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -662,9 +662,14 @@ ev_sidebar_thumbnails_set_document (EvSidebarPage *sidebar_page,
EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv;
- g_return_if_fail (EV_IS_DOCUMENT_THUMBNAILS (document));
-
priv->page_cache = ev_page_cache_get (document);
+
+ if (!EV_IS_DOCUMENT_THUMBNAILS (document) ||
+ ev_page_cache_get_n_pages (priv->page_cache) <= 0 ||
+ ev_page_cache_check_dimensions (priv->page_cache)) {
+ return;
+ }
+
priv->document = document;
priv->n_pages = ev_page_cache_get_n_pages (priv->page_cache);
priv->loading_icons = g_hash_table_new_full (g_str_hash,