aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libcrystfel/src/hdf5-file.c3
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;