Ignore:
Timestamp:
2013-10-27T03:20:19+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #9189 - NPE when deleting data layer + additional usage of Main.isDisplayingMapView()

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
3 edited

Legend:

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

    r6316 r6333  
    407407        }
    408408        // repaint to make sure new data is displayed properly.
    409         if (Main.map != null && Main.map.mapView != null) {
     409        if (Main.isDisplayingMapView()) {
    410410            Main.map.mapView.repaint();
    411411        }
  • trunk/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java

    r6070 r6333  
    156156    @Override
    157157    public void layerRemoved(Layer oldLayer) {
    158         if (oldLayer instanceof OsmDataLayer && Main.map != null && Main.map.mapView.getEditLayer() == null) {
     158        if (oldLayer instanceof OsmDataLayer && Main.isDisplayingMapView() && Main.map.mapView.getEditLayer() == null) {
    159159            Main.main.removeLayer(this);
    160160        } else if (oldLayer == this) {
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r6313 r6333  
    604604            if (request.getState() != null && !request.isPrecacheOnly()) {
    605605                finishedRequests.add(request);
    606                 if (Main.map != null && Main.map.mapView != null) {
     606                if (Main.isDisplayingMapView()) {
    607607                    Main.map.mapView.repaint();
    608608                }
Note: See TracChangeset for help on using the changeset viewer.