Ignore:
Timestamp:
2024-04-08T07:30:10+02:00 (9 months ago)
Author:
GerdP
Message:

fix #23603: JOSM crashes while opening fit file generated by Suunto app on Android

  • replace check for existence of key in map by null check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java

    r35978 r36239  
    7777
    7878        // no HGT, check for elevation data in GPX
    79         if (!wpt.attr.containsKey(HEIGHT_ATTRIBUTE)) {
     79        // Parse elevation from GPX data
     80        String height = wpt.getString(HEIGHT_ATTRIBUTE);
     81        if (height == null) {
    8082            // GPX has no elevation data :-(
    8183            return NO_ELEVATION;
    8284        }
    8385
    84         // Parse elevation from GPX data
    85         String height = wpt.getString(ElevationHelper.HEIGHT_ATTRIBUTE);
    8686        try {
    8787            return Double.parseDouble(height);
Note: See TracChangeset for help on using the changeset viewer.