From: Ben Pfaff Date: Sat, 9 Apr 2011 23:53:26 +0000 (-0700) Subject: gui: Fix crash in Paired T-Test dialog on selecting first variable. X-Git-Tag: v0.7.8~77 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cb2b9c421440ddf413bbfd39642404ee67e86f5;p=pspp-builds.git 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. --- 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); }