aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/cell.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-03-03 13:02:51 +0100
committerThomas White <taw@physics.org>2017-03-03 13:02:51 +0100
commite3c6d8e8aec84f708e1098371ecb4621ad17223f (patch)
tree1a6bb6db7c94a475caf7077408f16919f6a8308f /libcrystfel/src/cell.c
parent9674c801f9eae6a807ecaf12b119aa3f6ee6fd77 (diff)
Return error code if cell can't be inverted
Diffstat (limited to 'libcrystfel/src/cell.c')
-rw-r--r--libcrystfel/src/cell.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index ec591e24..3de61073 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -460,10 +460,12 @@ int cell_get_parameters(UnitCell *cell, double *a, double *b, double *c,
case CELL_REP_RECIP:
/* Convert reciprocal -> crystallographic.
* Start by converting reciprocal -> cartesian */
- cell_invert(cell->axs, cell->ays, cell->azs,
- cell->bxs, cell->bys, cell->bzs,
- cell->cxs, cell->cys, cell->czs,
- &ax, &ay, &az, &bx, &by, &bz, &cx, &cy, &cz);
+ if ( cell_invert(cell->axs, cell->ays, cell->azs,
+ cell->bxs, cell->bys, cell->bzs,
+ cell->cxs, cell->cys, cell->czs,
+ &ax, &ay, &az,
+ &bx, &by, &bz,
+ &cx, &cy, &cz) ) return 1;
/* Now convert cartesian -> crystallographic */
*a = modulus(ax, ay, az);