aboutsummaryrefslogtreecommitdiffstats
path: root/core/taxonomy.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/taxonomy.c')
-rw-r--r--core/taxonomy.c5
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;