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 26418)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 26419)
@@ -421,5 +421,7 @@
 		if (layerMap.size() == 0) {
 			setModel(null);
-			profileLayer.setProfile(null);
+			if (profileLayer != null) {
+				profileLayer.setProfile(null);
+			}
 		}
 	}
