From: Jason H Stover Date: Mon, 9 Feb 2009 16:27:00 +0000 (-0500) Subject: Skip the SAVE subcommand if no valid data are present, instead of crashing. X-Git-Tag: v0.7.3~299 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df471394b593ce8ecae691666e5451474f55ffd0;p=pspp-builds.git Skip the SAVE subcommand if no valid data are present, instead of crashing. Fix for bug 25523 --- diff --git a/src/language/stats/regression.q b/src/language/stats/regression.q index 595e7e75..d82d5549 100644 --- a/src/language/stats/regression.q +++ b/src/language/stats/regression.q @@ -689,17 +689,21 @@ subcommand_save (struct dataset *ds, int save, pspp_linreg_cache ** models) for (lc = models; lc < models + cmd.n_dependent; lc++) { - assert (*lc != NULL); - assert ((*lc)->depvar != NULL); - if (cmd.a_save[REGRESSION_SV_RESID]) - { - reg_save_var (ds, "RES", regression_trns_resid_proc, *lc, - &(*lc)->resid, n_trns); - } - if (cmd.a_save[REGRESSION_SV_PRED]) + if (*lc != NULL) { - reg_save_var (ds, "PRED", regression_trns_pred_proc, *lc, - &(*lc)->pred, n_trns); + if ((*lc)->depvar != NULL) + { + if (cmd.a_save[REGRESSION_SV_RESID]) + { + reg_save_var (ds, "RES", regression_trns_resid_proc, *lc, + &(*lc)->resid, n_trns); + } + if (cmd.a_save[REGRESSION_SV_PRED]) + { + reg_save_var (ds, "PRED", regression_trns_pred_proc, *lc, + &(*lc)->pred, n_trns); + } + } } } }