summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Aliste <[email protected]>2014-09-25 16:58:12 -0300
committerraveit65 <[email protected]>2017-08-28 16:04:01 +0200
commit475bbe2a78a4523752afad34d5b951903c3b3e35 (patch)
treeba63298faf33d0b889a31d4b56582ceb0aea2968
parent4fc9b355075c0298b0306f43e5b73d136dcdf939 (diff)
downloadatril-475bbe2a78a4523752afad34d5b951903c3b3e35.tar.bz2
atril-475bbe2a78a4523752afad34d5b951903c3b3e35.tar.xz
shell: Check if doc implements Annotations interface before cast
Without this check, evince will crash when a right-click on a non-pdf document is performed. https://bugzilla.gnome.org/show_bug.cgi?id=737197 origin commit: https://git.gnome.org/browse/evince/commit/?id=0f59861
-rw-r--r--shell/ev-window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index ecdc86bf..b33637bd 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -5361,7 +5361,8 @@ view_menu_annot_popup (EvWindow *ev_window,
{
GtkAction *action;
gboolean show_annot = FALSE;
- gboolean can_remove_annots;
+ gboolean can_remove_annots = FALSE;
+
if (ev_window->priv->document->iswebdocument == TRUE ) return ;
if (ev_window->priv->annot)
g_object_unref (ev_window->priv->annot);
@@ -5371,7 +5372,8 @@ view_menu_annot_popup (EvWindow *ev_window,
"AnnotProperties");
gtk_action_set_visible (action, (annot != NULL && EV_IS_ANNOTATION_MARKUP (annot)));
- can_remove_annots = ev_document_annotations_can_remove_annotation (EV_DOCUMENT_ANNOTATIONS (ev_window->priv->document));
+ if (EV_IS_DOCUMENT_ANNOTATIONS (ev_window->priv->document))
+ can_remove_annots = ev_document_annotations_can_remove_annotation (EV_DOCUMENT_ANNOTATIONS (ev_window->priv->document));
action = gtk_action_group_get_action (ev_window->priv->view_popup_action_group,
"RemoveAnnot");