From bc1dc265d43b189a954d08573ba1cf2dc2ee42d3 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 14 Dec 2023 11:34:17 +0100 Subject: index_pattern: Gracefully handle image with no peaks --- libcrystfel/src/index.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index e3512b4a..f519c3b9 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -949,6 +949,10 @@ void index_pattern_4(struct image *image, IndexingPrivate *ipriv, int *ping, image->crystals = NULL; image->n_crystals = 0; + /* No peaks? */ + if ( image->features == NULL ) return; + if ( image_feature_count(image->features) == 0 ) return; + if ( !isnan(ipriv->wavelength_estimate) ) { if ( !within_tolerance(image->lambda, ipriv->wavelength_estimate, -- cgit v1.2.3