Don't crash when attempting to enter data in a column without a variable
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 19 Apr 2017 13:14:41 +0000 (15:14 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 19 Apr 2017 13:14:41 +0000 (15:14 +0200)
src/ui/gui/psppire-data-editor.c

index d97768685139766f71fb4e9946071e9c10a5830f..c471bc1483ef6536090fc159b78e4aeed84a9861 100644 (file)
@@ -621,6 +621,9 @@ refresh_entry (PsppireDataEditor *de)
     {
       union value val;
       const struct variable *var = psppire_dict_get_variable (de->dict, col);
+      if (var == NULL)
+       return;
+
       psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (de->datum_entry), var);
 
       int width = var_get_width (var);