mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge pull request #641 from Subsurface-divelog/taxonomyCrashFix
Taxonomy crash fix
This commit is contained in:
commit
30be43c311
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue