Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1865)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 1866)
@@ -101,10 +101,10 @@
         //
         JPanel buttonPanel = new JPanel(new GridLayout(1,3));
-        buttonPanel.add(new SideButton(marktr("New"), "addrelation", "Selection", tr("Create a new relation"), new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                // call relation editor with null argument to create new relation
-                RelationEditor.getEditor(Main.map.mapView.getEditLayer(),null, null).setVisible(true);
-            }
-        }), GBC.std());
+
+        // the new action
+        //
+        NewAction newAction = new NewAction();
+        Layer.listeners.add(newAction);
+        buttonPanel.add(new SideButton(newAction), GBC.std());
 
         // the edit action
@@ -313,3 +313,40 @@
         }
     }
+
+    /**
+     * The edit action
+     *
+     */
+    class NewAction extends AbstractAction implements LayerChangeListener{
+        public NewAction() {
+            putValue(SHORT_DESCRIPTION,tr("Create a new relation"));
+            putValue(NAME, tr("New"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "addrelation"));
+            setEnabled(false);
+        }
+
+        public void run() {
+            RelationEditor.getEditor(Main.map.mapView.getEditLayer(),null, null).setVisible(true);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            run();
+        }
+
+        protected void updateEnabledState() {
+            setEnabled(Main.main != null && Main.main.getEditLayer() != null);
+        }
+
+        public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+            updateEnabledState();
+        }
+
+        public void layerAdded(Layer newLayer) {
+            updateEnabledState();
+        }
+
+        public void layerRemoved(Layer oldLayer) {
+            updateEnabledState();
+        }
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java	(revision 1865)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java	(revision 1866)
@@ -89,5 +89,14 @@
     }
 
-    protected RelationEditor(OsmDataLayer layer, Relation relation, Collection<RelationMember> selectedMembers) {
+    /**
+     * Creates a new relation editor
+     * 
+     * @param layer  the {@see OsmDataLayer} in whose context a relation is edited. Must not be null.
+     * @param relation the relation. Can be null if a new relation is to be edited.
+     * @param selectedMembers  a collection of members in <code>relation</code> which the editor
+     * should display selected when the editor is first displayed on screen
+     * @throws IllegalArgumentException thrown if layer is null
+     */
+    protected RelationEditor(OsmDataLayer layer, Relation relation, Collection<RelationMember> selectedMembers)  throws IllegalArgumentException{
         // Initalizes ExtendedDialog
         super(Main.parent,
@@ -96,4 +105,6 @@
                 false
         );
+        if (layer == null)
+            throw new IllegalArgumentException(tr("parameter ''layer'' must not be null", "layer"));
         this.layer = layer;
         setRelation(relation);
