diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-06-16 17:52:59 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-06-16 17:52:59 (GMT) |
commit | 31a1e800e5d6b24d8833ba28746b7ff6f2fbe6a9 (patch) | |
tree | 3ac4adda52e613740fb1b2c31b56d5d60d8f86f6 /shell/ev-sidebar-thumbnails.c | |
parent | 17f37a4bdb3e37586121edebd9e48cb24340b677 (diff) |
Do not crash opening documents with no pages and show a warning message in
2008-06-16 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc: (pdf_document_get_info):
* shell/ev-sidebar-thumbnails.c:
(ev_sidebar_thumbnails_set_loading_icon),
(ev_sidebar_thumbnails_refresh):
* shell/ev-window.c: (ev_window_error_message),
(ev_window_warning_message), (ev_window_refresh_window_thumbnail),
(ev_window_set_document):
Do not crash opening documents with no pages and show a warning
message in the message area. Fixes bugs #537574 and #171588.
svn path=/trunk/; revision=3052
Diffstat (limited to 'shell/ev-sidebar-thumbnails.c')
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 25b1b83..74b4ab7 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -403,7 +403,8 @@ ev_sidebar_thumbnails_set_loading_icon (EvSidebarThumbnails *sidebar_thumbnails) if (sidebar_thumbnails->priv->loading_icon) g_object_unref (sidebar_thumbnails->priv->loading_icon); - if (sidebar_thumbnails->priv->document) { + if (sidebar_thumbnails->priv->document && + sidebar_thumbnails->priv->n_pages > 0) { gint width, height; /* We get the dimensions of the first page so that we can make a blank @@ -434,7 +435,8 @@ ev_sidebar_thumbnails_refresh (EvSidebarThumbnails *sidebar_thumbnails, sidebar_thumbnails->priv->rotation = rotation; ev_sidebar_thumbnails_set_loading_icon (sidebar_thumbnails); - if (sidebar_thumbnails->priv->document == NULL) + if (sidebar_thumbnails->priv->document == NULL || + sidebar_thumbnails->priv->n_pages <= 0) return; ev_sidebar_thumbnails_clear_model (sidebar_thumbnails); |