aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/detector.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c
index 75d5bdb9..8c2f3828 100644
--- a/libcrystfel/src/detector.c
+++ b/libcrystfel/src/detector.c
@@ -1740,6 +1740,8 @@ struct detector *copy_geom(const struct detector *in)
struct detector *out;
int i;
+ if ( in == NULL ) return NULL;
+
out = malloc(sizeof(struct detector));
memcpy(out, in, sizeof(struct detector));