From e500a9dea87a9bb61e7b320bb1ae59206ae2fb8e Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Thu, 8 Oct 2015 21:24:01 +0300 Subject: Ignore geolookups without value It seems that geolookups might return null for some values. This will result in corrupted XML as show_utf8 does not terminate the current tag if t->value is empty. So let's just skip the geo data that is missing the value. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- save-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save-xml.c b/save-xml.c index 0fdb39091..166885861 100644 --- a/save-xml.c +++ b/save-xml.c @@ -555,7 +555,7 @@ void save_dives_buffer(struct membuffer *b, const bool select_only) if (ds->taxonomy.nr) { for (int j = 0; j < ds->taxonomy.nr; j++) { struct taxonomy *t = &ds->taxonomy.category[j]; - if (t->category != TC_NONE) { + if (t->category != TC_NONE && t->value) { put_format(b, " category); put_format(b, " origin='%d'", t->origin); show_utf8(b, t->value, " value='", "'/>\n", 1); -- cgit v1.2.3-70-g09d2