diff options
author | Thomas White <taw@physics.org> | 2023-06-16 14:55:24 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-07-28 13:22:05 +0200 |
commit | e2c50cf4d01c473e4d5f4ab632488b2b9987ebc9 (patch) | |
tree | 94374ab95c1b9c3374232592b64aae0223959be1 | |
parent | 4d7b87c1e9d57773733b22608d0c20513fad923d (diff) |
Avoid segfault if geometry file doesn't have groups
-rw-r--r-- | libcrystfel/src/datatemplate.c | 7 |
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; } |