Fix possible crash if no buttons are active (should never be the case)
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 30 Jul 2016 14:09:18 +0000 (16:09 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 30 Jul 2016 14:09:18 +0000 (16:09 +0200)
Found by cppcheck

src/ui/gui/psppire-val-chooser.c

index 25a34f1275dc7d813c81b09c086fe92ead436d48..2ff3f188c76b7d9dcc7c654fe62e7e5f33efdd94 100644 (file)
@@ -612,11 +612,10 @@ psppire_val_chooser_get_status (PsppireValChooser *vr, struct old_value *ov)
     {
       if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (vr->rw[i].rb)))
        {
+         range_opt[i].set (vr, ov, &vr->rw[i]);
          break;
        }
     }
-
-  range_opt[i].set (vr, ov, &vr->rw[i]);
 }
 
 /* This might need to be changed to something less naive.