aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/datatemplate.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-06-16 14:55:24 +0200
committerThomas White <taw@physics.org>2023-07-28 13:22:05 +0200
commite2c50cf4d01c473e4d5f4ab632488b2b9987ebc9 (patch)
tree94374ab95c1b9c3374232592b64aae0223959be1 /libcrystfel/src/datatemplate.c
parent4d7b87c1e9d57773733b22608d0c20513fad923d (diff)
Avoid segfault if geometry file doesn't have groups
Diffstat (limited to 'libcrystfel/src/datatemplate.c')
-rw-r--r--libcrystfel/src/datatemplate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/datatemplate.c b/libcrystfel/src/datatemplate.c
index 2126f313..16d1b68d 100644
--- a/libcrystfel/src/datatemplate.c
+++ b/libcrystfel/src/datatemplate.c
@@ -1984,7 +1984,12 @@ struct detgeom *create_detgeom(struct image *image,
}
detgeom->top_group = walk_group(dtempl, find_group(dtempl, "all"), detgeom, 0, 0);
- detgeom->top_group->parent = NULL;
+ if ( detgeom->top_group != NULL ) {
+ detgeom->top_group->parent = NULL;
+ } else {
+ ERROR("Warning: Top-level panel group ('all') not found. "
+ "Geometry refinement will not be possible.\n");
+ }
return detgeom;
}