diff options
author | Thomas White <taw@physics.org> | 2015-03-04 10:44:55 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2015-03-04 10:46:26 +0100 |
commit | e2cb8560d35b3cf9729a15477e8e7a9ba4181df8 (patch) | |
tree | 692f14780b404c423e93acb1737d46e81939b37e /libcrystfel | |
parent | 737ea397f8ce4c9b7bcb26a9057a42051f413942 (diff) |
Avoid segfault if cell can't be loaded
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/cell-utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index 7c7a58a6..43cf4337 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -1162,7 +1162,12 @@ UnitCell *load_cell_from_pdb(const char *filename) fclose(fh); - validate_cell(cell); + if ( cell != NULL ) { + validate_cell(cell); + } else { + ERROR("Failed to load cell from %s\n", filename); + } + return cell; } |