Changeset 8987 in josm


Ignore:
Timestamp:
2015-11-04T18:15:15+01:00 (9 years ago)
Author:
simon04
Message:

fix #12059 - NPE when converting GPX layer to data-layer from session.joz

Regression from r8830.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerAction.java

    r8830 r8987  
    130130        final DataSet ds = convert();
    131131        final OsmDataLayer layer = new OsmDataLayer(ds, tr("Converted from: {0}", this.layer.getName()), null);
    132         layer.setAssociatedFile(new File(this.layer.getAssociatedFile().getParentFile(), this.layer.getAssociatedFile().getName() + ".osm"));
     132        if (this.layer.getAssociatedFile() != null) {
     133            layer.setAssociatedFile(new File(this.layer.getAssociatedFile().getParentFile(), this.layer.getAssociatedFile().getName() + ".osm"));
     134        }
    133135        layer.setUploadDiscouraged(true);
    134136        Main.main.addLayer(layer);
Note: See TracChangeset for help on using the changeset viewer.