aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-02-23 17:20:45 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:41 +0100
commitaf6049b9a7f51835d8ad2b1cbb4576f2cb6f0adc (patch)
treee440bdc8dee628249b2ed03ea257997d515640b2 /src/post-refinement.c
parent24c9345dbab2bd51e91f00a229c6b5b8b712c86e (diff)
Don't allow profile radius to go negative
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index c57073c4..ef8ae844 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -307,6 +307,11 @@ static double residual_f(const gsl_vector *v, void *pp)
crystal_set_image(cr, &im);
apply_parameters(v, pv->initial, pv->rv, cr);
+ if ( crystal_get_profile_radius(cr) < 0.0 ) {
+ crystal_free(cr);
+ return INFINITY;
+ }
+
list = copy_reflist(crystal_get_reflections(cr));
crystal_set_reflections(cr, list);