aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-24 15:04:21 +0100
committerThomas White <taw@physics.org>2017-03-24 15:04:21 +0100
commitc5ab3a8e0305995ed97fc85a5c190c069794fdb0 (patch)
tree8fd6bfbbac503d1dc538c2748f47e11a616a9d34
parent1f613c288763a165b6e803d918f9fd8613996212 (diff)
Propagate error if indexing method is unrecognised
-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 028ba5e9..685d0b69 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -163,6 +163,10 @@ IndexingPrivate *setup_indexing(const char *method_list, UnitCell *cell,
for ( i=0; i<n; i++ ) {
methods[i] = get_indm_from_string(method_strings[i]);
+ if ( methods[i] == INDEXING_ERROR ) {
+ free(methods);
+ return NULL;
+ }
}
ipriv = malloc(sizeof(struct _indexingprivate));