From 0cb2b9c421440ddf413bbfd39642404ee67e86f5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 9 Apr 2011 16:53:26 -0700 Subject: [PATCH] gui: Fix crash in Paired T-Test dialog on selecting first variable. When a variable is moved into the list of selected variables in the Paired T-Test dialog, that row of the treeview has one nonnull variable and one null variable. Calling var_get_name(NULL) causes a segfault. I'm not certain that this is the correct fix, but it fixes the segfault. The missing variable is now shown as until a second variable is moved into the treeview. Bug #32958. --- src/ui/gui/psppire-var-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/gui/psppire-var-view.c b/src/ui/gui/psppire-var-view.c index 73bd9d8d..a840539d 100644 --- a/src/ui/gui/psppire-var-view.c +++ b/src/ui/gui/psppire-var-view.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2009 Free Software Foundation + Copyright (C) 2009, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -141,7 +141,7 @@ display_cell_var_name (GtkTreeViewColumn *tree_column, g_value_unset (&value); - g_object_set (cell, "text", var_get_name (var), NULL); + g_object_set (cell, "text", var ? var_get_name (var) : "", NULL); } -- 2.30.2