Changeset 9276 in josm


Ignore:
Timestamp:
2016-01-03T14:19:01+01:00 (8 years ago)
Author:
simon04
Message:

fix #12283 - Download notes in current view: fix NPE

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r9238 r9276  
    144144     */
    145145    public static boolean isDisplayingMapView() {
    146         if (map == null) return false;
    147         if (map.mapView == null) return false;
    148         return true;
     146        return map != null && map.mapView != null;
    149147    }
    150148
  • trunk/src/org/openstreetmap/josm/actions/DownloadNotesInViewAction.java

    r8663 r9276  
    4343    @Override
    4444    protected void updateEnabledState() {
    45         setEnabled(Main.map != null && Main.map.mapView != null && !Main.isOffline(OnlineResource.OSM_API));
     45        setEnabled(Main.isDisplayingMapView()
     46                && Main.map.mapView.getActiveLayer() != null
     47                && !Main.isOffline(OnlineResource.OSM_API));
    4648    }
    4749}
Note: See TracChangeset for help on using the changeset viewer.