aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-09-07 16:26:22 +0200
committerThomas White <taw@physics.org>2021-09-07 16:26:22 +0200
commit3f025979f473bb70f0cabc149ece98fddb5d1d73 (patch)
tree4bbcafb250f525b11161e72f295506c4ee854217 /libcrystfel
parent2f33ebae655a7f6189f10c7676d8fc870f706afe (diff)
lookup_panel: Check that panel name is not NULL
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/datatemplate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index 7f7f24af..cea963ec 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -973,6 +973,11 @@ static int lookup_panel(const char *panel_name,
return 0;
}
+ if ( panel_name == NULL ) {
+ ERROR("Panel name must be specified.\n");
+ return 1;
+ }
+
for ( i=0; i<dt->n_panels; i++ ) {
if ( strcmp(dt->panels[i].name, panel_name) == 0 ) {
*res = i;