Index: applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
===================================================================
--- applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 32315)
+++ applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 32329)
@@ -196,5 +196,5 @@
         MapView.addLayerChangeListener(this);
         if (Main.isDisplayingMapView()) {
-            Layer layer = Main.map.mapView.getActiveLayer();
+            Layer layer = Main.getLayerManager().getActiveLayer();
             if (layer instanceof GpxLayer) {
                 setActiveLayer((GpxLayer) layer);
