aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-02-15 17:04:51 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:42 +0100
commit6ac71ea6671b9bf4b5c8978603c84d4d49775d38 (patch)
treee603691d5e9c4cbfe900e8d4b0d421c4b7976d9e /src
parentc240adce86d36553d445422b4af3a76183925cee (diff)
Trap lambda<0
Diffstat (limited to 'src')
-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);