Changeset 2625 in josm for trunk


Ignore:
Timestamp:
2009-12-13T09:30:46+01:00 (12 years ago)
Author:
Gubaer
Message:

fixed #4159: NPE when deleting a data layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java

    r2622 r2625  
    6262    }
    6363
     64    /* --------------------------------------------------------------------------- */
     65    /* interface LayerChangeListener                                               */
     66    /* --------------------------------------------------------------------------- */
    6467    public void activeLayerChange(Layer a, Layer b) {
    6568        if (a != null && a instanceof OsmDataLayer) {
     
    6972            ((OsmDataLayer)b).data.addDataSetListener(myListener);
    7073        }
    71         processDatasetEvent(new DataChangedEvent(Main.main.getEditLayer().data));
     74        if (Main.main.getEditLayer() != null) {
     75            processDatasetEvent(new DataChangedEvent(Main.main.getEditLayer().data));
     76        }
    7277    }
    7378    public void layerRemoved(Layer a) {/* irrelevant in this context */}
Note: See TracChangeset for help on using the changeset viewer.