aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/post-refinement.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index b2fbb537..0966d454 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -330,6 +330,12 @@ static double residual_f(const gsl_vector *v, void *pp)
return GSL_NAN;
}
+ if ( im.lambda <= 0.0 ) {
+ crystal_free(cr);
+ if ( pv->verbose ) STATUS("lambda < 0\n");
+ return GSL_NAN;
+ }
+
list = copy_reflist(crystal_get_reflections(cr));
crystal_set_reflections(cr, list);