aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-08-14 14:04:52 +0200
committerThomas White <taw@physics.org>2019-08-16 10:26:58 +0200
commit0aa9e1af6d48b490906231192235f51232ed38f0 (patch)
tree5b029c4ce1b5d4d8c08ee86b8f6bfaffd6a20ee1
parentaf115ec0a455929352fef516c35d2b77cd283e9d (diff)
cell_print{_full}: Handle NULL cell
-rw-r--r--libcrystfel/src/cell-utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c
index 82b42b98..f6e189ad 100644
--- a/libcrystfel/src/cell-utils.c
+++ b/libcrystfel/src/cell-utils.c
@@ -213,6 +213,11 @@ void cell_print(UnitCell *cell)
LatticeType lt;
char cen;
+ if ( cell == NULL ) {
+ STATUS("(NULL cell)\n");
+ return;
+ }
+
lt = cell_get_lattice_type(cell);
cen = cell_get_centering(cell);
@@ -253,8 +258,8 @@ void cell_print(UnitCell *cell)
void cell_print_full(UnitCell *cell)
{
-
cell_print(cell);
+ if ( cell == NULL ) return;
if ( cell_has_parameters(cell) ) {