diff options
-rw-r--r-- | libcrystfel/src/integer_matrix.c | 5 | ||||
-rw-r--r-- | libcrystfel/src/rational.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libcrystfel/src/integer_matrix.c b/libcrystfel/src/integer_matrix.c index 1d1c3a47..9431d189 100644 --- a/libcrystfel/src/integer_matrix.c +++ b/libcrystfel/src/integer_matrix.c @@ -406,6 +406,11 @@ void intmat_print(const IntegerMatrix *m) { unsigned int i, j; + if ( m == NULL ) { + fprintf(stderr, "(NULL matrix)\n"); + return; + } + for ( i=0; i<m->rows; i++ ) { fprintf(stderr, "[ "); diff --git a/libcrystfel/src/rational.c b/libcrystfel/src/rational.c index 88a485ff..fe87c034 100644 --- a/libcrystfel/src/rational.c +++ b/libcrystfel/src/rational.c @@ -510,6 +510,11 @@ void rtnl_mtx_print(const RationalMatrix *m) { unsigned int i, j; + if ( m == NULL ) { + fprintf(stderr, "(NULL matrix)\n"); + return; + } + for ( i=0; i<m->rows; i++ ) { fprintf(stderr, "[ "); |