aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/cell.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcrystfel/src/cell.c b/libcrystfel/src/cell.c
index 1e463bf7..ce9d37bb 100644
--- a/libcrystfel/src/cell.c
+++ b/libcrystfel/src/cell.c
@@ -876,9 +876,13 @@ UnitCell *cell_transform_rational(UnitCell *cell, RationalMatrix *m)
gsl_matrix *tm;
char ncen;
int i, j;
+ Rational det;
if ( m == NULL ) return NULL;
+ det = rtnl_mtx_det(m);
+ if ( rtnl_cmp(det, rtnl_zero()) == 0 ) return NULL;
+
tm = gsl_matrix_alloc(3,3);
if ( tm == NULL ) {
return NULL;