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


Ignore:
Timestamp:
2009-06-06T13:21:56+02:00 (15 years ago)
Author:
stoecker
Message:

fix #2688 - patch by jttt - solve NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r1605 r1633  
    167167     */
    168168    public final void removeLayer(final Layer layer) {
    169         map.mapView.removeLayer(layer);
    170         if (layer instanceof OsmDataLayer)
    171             ds = new DataSet();
    172         if (map.mapView.getAllLayers().isEmpty())
    173             setMapFrame(null);
     169        if (map != null) {
     170            map.mapView.removeLayer(layer);
     171            if (layer instanceof OsmDataLayer)
     172                ds = new DataSet();
     173            if (map.mapView.getAllLayers().isEmpty())
     174                setMapFrame(null);
     175        }
    174176    }
    175177
Note: See TracChangeset for help on using the changeset viewer.