Ignore:
Timestamp:
2017-06-22T01:07:31+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #14924 - fix NPE when reading NMEA files starting with a (0,0) coordinate followed by a VTG sentence

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/nmea/NmeaReader.java

    r12421 r12422  
    342342                    // other values than (T)rue are ignored
    343343                    accu = e[VTG.COURSE.position];
    344                     if (!accu.isEmpty()) {
     344                    if (!accu.isEmpty() && currentwp != null) {
    345345                        Double.parseDouble(accu);
    346346                        currentwp.put("course", accu);
     
    351351                if (accu.startsWith("K")) {
    352352                    accu = e[VTG.SPEED_KMH.position];
    353                     if (!accu.isEmpty()) {
     353                    if (!accu.isEmpty() && currentwp != null) {
    354354                        double speed = Double.parseDouble(accu);
    355355                        speed /= 3.6; // speed in m/s
Note: See TracChangeset for help on using the changeset viewer.