aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-22 10:41:00 +0200
committerThomas White <taw@physics.org>2017-09-22 10:41:00 +0200
commit828dc729a87f9b26bd93304a03ff3447e4065e53 (patch)
treeff23e64f9b054aabc25ac46808728b35e0b58715 /src/indexamajig.c
parentda0eb05f93b9e503b2003fcea77dd68372fc855d (diff)
indexamajig: Avoid segfault when no unit cell given
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index bdb2af96..b7f464de 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -803,7 +803,6 @@ int main(int argc, char *argv[])
}
free(cellfile);
} else {
- STATUS("No unit cell given.\n");
iargs.cell = NULL;
}
@@ -884,8 +883,12 @@ int main(int argc, char *argv[])
IndexingFlags flags = 0;
- STATUS("This is what I understood your unit cell to be:\n");
- cell_print(iargs.cell);
+ if ( iargs.cell != NULL ) {
+ STATUS("This is what I understood your unit cell to be:\n");
+ cell_print(iargs.cell);
+ } else {
+ STATUS("No reference unit cell provided.\n");
+ }
if ( if_nocomb ) {
flags |= INDEXING_CHECK_CELL_AXES;