aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-03-03 16:33:26 +0100
committerThomas White <taw@physics.org>2010-03-03 16:33:26 +0100
commitd5e10b751ce5032af1de0768e162f62800248ae2 (patch)
treeee93790cc37005502b725b72ec07aab8d3ac014f
parent27c1ee4eb71f4a664f8ddc39f6453ad3653c0c72 (diff)
Don't crash if a peak can't be mapped
-rw-r--r--src/detector.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/detector.c b/src/detector.c
index 92094639..6a6b260e 100644
--- a/src/detector.c
+++ b/src/detector.c
@@ -34,6 +34,7 @@ int map_position(struct image *image, double dx, double dy,
double y = 0.0;
p = find_panel(&image->det, dx, dy);
+ if ( p == NULL ) return 1;
x = ((double)dx - p->cx);
y = ((double)dy - p->cy);