Index: applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java
===================================================================
--- applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java	(revision 32287)
+++ applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/downloadtask/DownloadXmlBoundsTask.java	(revision 32329)
@@ -73,5 +73,5 @@
             int count = 0;
             if (!Main.isDisplayingMapView()) return 0;
-            for (Layer layer : Main.map.mapView.getAllLayers()) {
+            for (Layer layer : Main.getLayerManager().getLayers()) {
                 if (layer instanceof XmlBoundsLayer) {
                     count++;
@@ -84,5 +84,5 @@
         protected OsmDataLayer getFirstDataLayer() {
             if (!Main.isDisplayingMapView()) return null;
-            for (Layer layer : Main.map.mapView.getAllLayersAsList()) {
+            for (Layer layer : Main.getLayerManager().getLayers()) {
                 if (layer instanceof XmlBoundsLayer)
                     return (XmlBoundsLayer) layer;
