summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-01-29 19:06:08 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-30 12:07:13 +1100
commit0fb1fe8c6e16279f1c69d912edccdac04bfe76d2 (patch)
treed052d74b706bc471d6f940f0e933da561e3768e9 /divelist.c
parent9b47dc1f5920be228d2b4e6b91f361a52d40eb87 (diff)
downloadsubsurface-0fb1fe8c6e16279f1c69d912edccdac04bfe76d2.tar.gz
Fix segfault pressing Menu key
Pierre wrote: "On my keyboard I have a key on the right side of the space bar, between the alt+gr key and the right ctrl which most of the time emulates the right mouse click. If I press this button on subsurface, I end up with: Segmentation fault (core dumped) This whatever the selection and nicely always reproducible." This patch doesn't make the key work, but it fixes the segfault. Reported-by: Pierre-Yves Chibon <pingou@pingoured.fr> Debugged-and-acked-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index 5ccc4face..882ba3bc6 100644
--- a/divelist.c
+++ b/divelist.c
@@ -2353,7 +2353,7 @@ static void popup_divelist_menu(GtkTreeView *tree_view, GtkTreeModel *model, int
int idx, previdx, nextidx;
struct dive *dive;
- if (!gtk_tree_view_get_path_at_pos(tree_view, event->x, event->y, &path, NULL, NULL, NULL))
+ if (!event || !gtk_tree_view_get_path_at_pos(tree_view, event->x, event->y, &path, NULL, NULL, NULL))
return;
gtk_tree_model_get_iter(MODEL(dive_list), &iter, path);
gtk_tree_model_get(MODEL(dive_list), &iter, DIVE_INDEX, &idx, -1);