diff options
author | Thomas White <taw@physics.org> | 2021-06-23 12:42:35 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-06-23 12:42:35 +0200 |
commit | 3f5c46eb1f85e7c1575edb583bc7e716626eca9d (patch) | |
tree | 6db9f3ce2c5ac79244defb5ecd4434cd37dc73f6 /src | |
parent | 49d918f6ac5f41bbd157e4952a4e5f9e2bfd3d8c (diff) |
GUI: Avoid writing '(null)' to project file
The problem is, '(null)' is not NULL.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui_project.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gui_project.c b/src/gui_project.c index 614a7a31..c3e40297 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -1037,10 +1037,14 @@ int save_project(struct crystfelproject *proj) proj->merging_params.min_measurements); fprintf(fh, "merging.max_adu %f\n", proj->merging_params.max_adu); - fprintf(fh, "merging.custom_split %s\n", - proj->merging_params.custom_split); - fprintf(fh, "merging.twin_sym %s\n", - proj->merging_params.twin_sym); + if ( proj->merging_params.custom_split != NULL ) { + fprintf(fh, "merging.custom_split %s\n", + proj->merging_params.custom_split); + } + if ( proj->merging_params.twin_sym != NULL ) { + fprintf(fh, "merging.twin_sym %s\n", + proj->merging_params.twin_sym); + } fprintf(fh, "merging.min_res %f\n", proj->merging_params.min_res); fprintf(fh, "merging.push_res %f\n", @@ -1063,7 +1067,9 @@ int save_project(struct crystfelproject *proj) fprintf(fh, "fom.num_bins %i\n", proj->fom_nbins); fprintf(fh, "fom.min_snr %f\n", proj->fom_min_snr); fprintf(fh, "fom.min_meas %i\n", proj->fom_min_meas); - fprintf(fh, "fom.cell_file %s\n", proj->fom_cell_filename); + if ( proj->fom_cell_filename != NULL ) { + fprintf(fh, "fom.cell_file %s\n", proj->fom_cell_filename); + } fprintf(fh, "show_centre %i\n", proj->show_centre); fprintf(fh, "show_peaks %i\n", proj->show_peaks); |