Ignore:
Timestamp:
2019-07-15T00:23:23+02:00 (5 years ago)
Author:
donvip
Message:

fix #josm17926 - NPE

File:
1 edited

Legend:

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

    r34928 r35066  
    1010import org.openstreetmap.josm.plugins.elevation.ElevationHelper;
    1111import org.openstreetmap.josm.plugins.elevation.IElevationProfile;
     12import org.openstreetmap.josm.tools.Logging;
    1213
    1314
     
    305306
    306307        if (wp1 != null && wp2 != null) {
    307             return wp2.getDate().getTime() - wp1.getDate().getTime();
     308            Date wp1Date = wp1.getDate();
     309            Date wp2Date = wp2.getDate();
     310            if (wp1Date != null && wp2Date != null) {
     311                return wp2Date.getTime() - wp1Date.getTime();
     312            } else {
     313                Logging.warn("Waypoints without date: " + wp1 + " / " + wp2);
     314            }
    308315        }
    309316
Note: See TracChangeset for help on using the changeset viewer.