From 235e8eb20240af5266b064ee931bc6723004bf4d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 9 Jul 2015 15:57:02 +0200 Subject: Tidy up error handling when given dodgy data locations --- libcrystfel/src/hdf5-file.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c index 9953b3e0..c58a3ae5 100644 --- a/libcrystfel/src/hdf5-file.c +++ b/libcrystfel/src/hdf5-file.c @@ -2370,6 +2370,11 @@ struct event_list *fill_event_list(struct hdfile *hdfile, struct detector *det) dh = H5Dopen2(hdfile->fh, full_panel_path, H5P_DEFAULT); + if ( dh < 0 ) { + ERROR("Failed to enumerate events. " + "Check your geometry file.\n"); + return NULL; + } sh = H5Dget_space(dh); dims = H5Sget_simple_extent_ndims(sh); -- cgit v1.2.3