diff options
author | Thomas White <taw@physics.org> | 2016-02-09 13:08:38 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2016-02-09 13:08:38 +0100 |
commit | 9b4f2c82012ca588086d4e0851fdcf63b19fc149 (patch) | |
tree | addceae39ac60b7445683647c2f38d6b4ea52fcc | |
parent | e0062398b44a1c3d77426cb17e14d7d7d4b10e35 (diff) |
Fix a NULL dereference
-rw-r--r-- | libcrystfel/src/hdf5-file.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |