Index: applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java
===================================================================
--- applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java	(revision 30737)
+++ applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java	(revision 32512)
@@ -62,8 +62,8 @@
         Main.info("Undeleting "+ids+(parent==null?"":" with parent "+parent));
         
-        OsmDataLayer tmpLayer = Main.main.getEditLayer();
+        OsmDataLayer tmpLayer = Main.getLayerManager().getEditLayer();
         if ((tmpLayer == null) || newLayer) {
             tmpLayer = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null);
-            Main.main.addLayer(tmpLayer);
+            Main.getLayerManager().addLayer(tmpLayer);
         }
 
