Browse Source

Make geojson writer not crash when there is no URL to write.

tags/gpsbabel_1_5_4
Robert Lipe 3 years ago
parent
commit
856b18db81
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      geojson.cc

+ 8
- 6
geojson.cc View File

@@ -74,12 +74,14 @@ geojson_waypt_pr(const Waypoint* waypoint) {
if (!waypoint->description.isEmpty()) {
properties["description"] = waypoint->description;
}
UrlLink link = waypoint->GetUrlLink();
if (!link.url_.isEmpty()) {
properties["url"] = link.url_;
}
if (!link.url_link_text_.isEmpty()) {
properties["urlname"] = link.url_link_text_;
if (waypoint->HasUrlLink()) {
UrlLink link = waypoint->GetUrlLink();
if (!link.url_.isEmpty()) {
properties["url"] = link.url_;
}
if (!link.url_link_text_.isEmpty()) {
properties["urlname"] = link.url_link_text_;
}
}
if (!properties.empty()) {
object["properties"] = properties;


Loading…
Cancel
Save