From a9668bc9b0bbb93cf2bbc7c2048c7019d38f9bdf Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 15 May 2015 16:45:44 +0200 Subject: Refuse all nan shifts --- src/post-refinement.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/post-refinement.c b/src/post-refinement.c index d314b536..aed15c2e 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -274,15 +274,17 @@ static void apply_shift(Crystal *cr, int k, double shift) double t; struct image *image = crystal_get_image(cr); + if ( isnan(shift) ) { + ERROR("Refusing NaN shift for parameter %i\n", k); + ERROR("Image serial %i\n", image->serial); + return; + } + switch ( k ) { case GPARAM_DIV : - if ( isnan(shift) ) { - ERROR("NaN divergence shift\n"); - } else { - image->div += shift; - if ( image->div < 0.0 ) image->div = 0.0; - } + image->div += shift; + if ( image->div < 0.0 ) image->div = 0.0; break; case GPARAM_R : -- cgit v1.2.3