aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-12-14 11:34:17 +0100
committerThomas White <taw@physics.org>2023-12-19 11:37:53 +0100
commitbc1dc265d43b189a954d08573ba1cf2dc2ee42d3 (patch)
tree419327efe8d4ba0a92d52130e98daa4c8b7d083a
parent2456f3bf75c7754f85e53895b465c4c44836805a (diff)
index_pattern: Gracefully handle image with no peaks
-rw-r--r--libcrystfel/src/index.c4
1 files changed, 4 insertions, 0 deletions
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,