[evince] history: Don't assume EvLink has always a valid EvLinkAction
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] history: Don't assume EvLink has always a valid EvLinkAction
- Date: Sat, 27 Jun 2020 04:49:22 +0000 (UTC)
commit 6d3f7570c76941d78b79906488ef862359de5369
Author: Nelson Benítez León <nbenitezl gmail com>
Date: Mon Sep 3 06:41:15 2018 -0700
history: Don't assume EvLink has always a valid EvLinkAction
Fixes following critical when navigating history with mouse
back/forward buttons:
EvinceDocument-CRITICAL **: ev_link_action_equal: assertion 'EV_IS_LINK_ACTION (b)' failed
Parially fixes #810 (5/5)
shell/ev-history.c | 7 ++++++-
shell/ev-window.c | 6 +++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/shell/ev-history.c b/shell/ev-history.c
index a0b33d18..9aa156f5 100644
--- a/shell/ev-history.c
+++ b/shell/ev-history.c
@@ -263,10 +263,15 @@ static gint
compare_link (EvLink *a,
EvLink *b)
{
+ EvLinkAction *aa, *bb;
+
if (a == b)
return 0;
- return ev_link_action_equal (ev_link_get_action (a), ev_link_get_action (b)) ? 0 : 1;
+ aa = ev_link_get_action (a);
+ bb = ev_link_get_action (b);
+
+ return (aa && bb && ev_link_action_equal (aa, bb)) ? 0 : 1;
}
/*
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 67f67190..a64ca238 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -882,6 +882,7 @@ find_link_cb (GtkTreeModel *tree_model,
LinkTitleData *data)
{
EvLink *link;
+ EvLinkAction *a, *b;
gboolean retval = FALSE;
gtk_tree_model_get (tree_model, iter,
@@ -890,7 +891,10 @@ find_link_cb (GtkTreeModel *tree_model,
if (!link)
return retval;
- if (ev_link_action_equal (ev_link_get_action (data->link), ev_link_get_action (link))) {
+ a = ev_link_get_action (data->link);
+ b = ev_link_get_action (link);
+
+ if (a && b && ev_link_action_equal (a, b)) {
data->link_title = ev_link_get_title (link);
retval = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]