From a32da73ccf7be0697d9a56b71f548a6c386d30b1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 20 Jan 2012 19:56:06 -0800 Subject: Check to see if there are any reflections --- libcrystfel/src/peaks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c index f837bcdb..a9c7145b 100644 --- a/libcrystfel/src/peaks.c +++ b/libcrystfel/src/peaks.c @@ -562,10 +562,11 @@ static struct integr_ind *sort_reflections(RefList *list, UnitCell *cell, *n = num_reflections(list); + if ( *n == 0 ) return NULL; + il = calloc(*n, sizeof(struct integr_ind)); if ( il == NULL ) return NULL; - for ( refl = first_refl(list, &iter); refl != NULL; refl = next_refl(refl, iter) ) -- cgit v1.2.3