diff options
author | Subsurface <dirk@subsurface-divelog.org> | 2017-10-05 22:27:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-05 22:27:02 -0700 |
commit | 30be43c3113102c768d622688ea26ae4f69e2319 (patch) | |
tree | e29e020686c7b6b0a61831c9f77c5799d760930a | |
parent | 90674cf7f8c2987536a5a93729ea1546acf0fe41 (diff) | |
parent | 80e6032f6fd57ea73bc4d7eab48277ec500f02a3 (diff) | |
download | subsurface-30be43c3113102c768d622688ea26ae4f69e2319.tar.gz |
Merge pull request #641 from Subsurface-divelog/taxonomyCrashFix
Taxonomy crash fix
-rw-r--r-- | core/taxonomy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/taxonomy.c b/core/taxonomy.c index a6d829fa1..8776862d6 100644 --- a/core/taxonomy.c +++ b/core/taxonomy.c @@ -61,6 +61,11 @@ const char *taxonomy_get_country(struct taxonomy_data *t) void taxonomy_set_country(struct taxonomy_data *t, const char *country, enum taxonomy_origin origin) { int idx = -1; + + // make sure we have taxonomy data allocated + if (!t->category) + t->category = alloc_taxonomy(); + for (int i = 0; i < t->nr; i++) { if (t->category[i].category == TC_COUNTRY) { idx = i; |