From 9b4f2c82012ca588086d4e0851fdcf63b19fc149 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 9 Feb 2016 13:08:38 +0100 Subject: Fix a NULL dereference --- libcrystfel/src/hdf5-file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c index 09eb4081..acb3b525 100644 --- a/libcrystfel/src/hdf5-file.c +++ b/libcrystfel/src/hdf5-file.c @@ -1014,7 +1014,8 @@ int hdf5_write_image(const char *filename, const struct image *image, write_location(fh, image->det, data, &locations[li]); } - if ( image->beam == NULL || image->beam->photon_energy_from == NULL ) { + if ( image->beam == NULL + || (image->beam != NULL && image->beam->photon_energy_from == NULL) ) { ph_en_loc = "photon_energy_eV"; } else { ph_en_loc = image->beam->photon_energy_from; -- cgit v1.2.3