From 0fb1fe8c6e16279f1c69d912edccdac04bfe76d2 Mon Sep 17 00:00:00 2001 From: Henrik Brautaset Aronsen Date: Tue, 29 Jan 2013 19:06:08 +0100 Subject: 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 Debugged-and-acked-by: Sergey Starosek Signed-off-by: Henrik Brautaset Aronsen Signed-off-by: Dirk Hohndel --- divelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'divelist.c') 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); -- cgit v1.2.3-70-g09d2