Index: applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java
===================================================================
--- applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java	(revision 31586)
+++ applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java	(revision 32329)
@@ -79,5 +79,5 @@
     private void checkLayers() {
         if (Main.map != null && Main.map.mapView != null) {
-            for (Layer layer:Main.map.mapView.getAllLayers()) {
+            for (Layer layer:Main.getLayerManager().getLayers()) {
                 if (layer instanceof OsmDataLayer) {
                     if (!isShown) {
