Changeset 33419 in osm for applications/editors/josm


Ignore:
Timestamp:
2017-06-30T09:08:46+02:00 (8 years ago)
Author:
glebius
Message:

Protect against invalid TPV that doesn't have lon or lat.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsAcquirer.java

    r33078 r33419  
    278278            return null;
    279279
    280         lat = report.getJsonNumber("lat").doubleValue();
    281         lon = report.getJsonNumber("lon").doubleValue();
     280        JsonNumber latJson = report.getJsonNumber("lat");
     281        JsonNumber lonJson = report.getJsonNumber("lon");
     282        if (latJson == null || lonJson == null)
     283            return null;
     284        lat = latJson.doubleValue();
     285        lon = lonJson.doubleValue();
    282286
    283287        JsonNumber epxJson = report.getJsonNumber("epx");
Note: See TracChangeset for help on using the changeset viewer.