From 3fe3051453cad77a2964c96b53caf4e5a432b2fe Mon Sep 17 00:00:00 2001 From: Nickolay V. Shmyrev Date: Sun, 03 May 2009 11:35:39 +0000 Subject: [document] Fixes handling of broken documents Instead of aborting on assertion, we gracefully report that document is broken. Fixes GNOME bug #580886. --- (limited to 'shell/ev-sidebar-thumbnails.c') 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, -- cgit v0.9.1