From cc9fba732caad42a0ad9230ba22e65e4d3e6f571 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 8 Apr 2014 15:17:06 +0200 Subject: ambigator: Avoid NULL dereference if unit cell is not found in stream --- src/ambigator.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ambigator.c b/src/ambigator.c index a922cacc..c55148b3 100644 --- a/src/ambigator.c +++ b/src/ambigator.c @@ -115,9 +115,13 @@ static struct flist *asymm_and_merge(RefList *in, const SymOpList *sym, get_indices(refl, &h, &k, &l); - res = 2.0*resolution(cell, h, k, l); - if ( res < rmin ) continue; - if ( res > rmax ) continue; + if ( cell != NULL ) { + ERROR("Can't calculate resolution cutoff - no cell\n"); + } else { + res = 2.0*resolution(cell, h, k, l); + if ( res < rmin ) continue; + if ( res > rmax ) continue; + } get_asymm(sym, h, k, l, &ha, &ka, &la); -- cgit v1.2.3