summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-04-07 09:58:36 +0200
committerAnton Khirnov <anton@khirnov.net>2019-04-07 09:58:36 +0200
commit9c47c8202644e20e6ae054a6c7ddf09b6a0e4808 (patch)
tree3fdca5bfab11bb4292515a3a1c43d3688cda86d5
parent2e03749bb901494f857547cc518ad58eea76a098 (diff)
mg2d: do not crash if print_stats() is called before any solves
-rw-r--r--mg2d.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mg2d.c b/mg2d.c
index c9070fb..b1c7fb7 100644
--- a/mg2d.c
+++ b/mg2d.c
@@ -772,6 +772,9 @@ void mg2d_print_stats(MG2DContext *ctx, const char *prefix)
MG2DLevel *level = priv->root;
int64_t other, levels_total = 0;
+ if (!level)
+ return;
+
if (!prefix)
prefix = "";