Changeset 14797 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2019-02-22T22:35:25+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #17367 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

    r14456 r14797  
    176176    }
    177177
    178     private static Double getElevation(WayPoint wp) {
    179         String value = wp.getString(GpxConstants.PT_ELE);
    180         if (value != null && !value.isEmpty()) {
    181             try {
    182                 return Double.valueOf(value);
    183             } catch (NumberFormatException e) {
    184                 Logging.warn(e);
     178    static Double getElevation(WayPoint wp) {
     179        if (wp != null) {
     180            String value = wp.getString(GpxConstants.PT_ELE);
     181            if (value != null && !value.isEmpty()) {
     182                try {
     183                    return Double.valueOf(value);
     184                } catch (NumberFormatException e) {
     185                    Logging.warn(e);
     186                }
    185187            }
    186188        }
Note: See TracChangeset for help on using the changeset viewer.