Index: trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 9396)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 9397)
@@ -1468,5 +1468,5 @@
         @Override
         protected Collection<Bounds> getBounds() {
-            return Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
+            return Main.main == null || Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
                     ? null : Main.main.getCurrentDataSet().getDataSourceBounds();
         }
@@ -1475,4 +1475,29 @@
         public String toString() {
             return all ? "allindownloadedarea" : "indownloadedarea";
+        }
+    }
+
+    /**
+     * Matches objects which are not outside the source area ("downloaded area").
+     * Unlink {@link InDataSourceArea} this matches also if no source area is set (e.g., for new layers).
+     */
+    public static class NotOutsideDataSourceArea extends InDataSourceArea {
+
+        /**
+         * Constructs a new {@code NotOutsideDataSourceArea}.
+         */
+        public NotOutsideDataSourceArea() {
+            super(false);
+        }
+
+        @Override
+        protected Collection<Bounds> getBounds() {
+            final Collection<Bounds> bounds = super.getBounds();
+            return bounds == null || bounds.isEmpty() ? Collections.singleton(Main.getProjection().getWorldBoundsLatLon()) : bounds;
+        }
+
+        @Override
+        public String toString() {
+            return "NotOutsideDataSourceArea";
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/validation/Test.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 9396)
+++ trunk/src/org/openstreetmap/josm/data/validation/Test.java	(revision 9397)
@@ -14,5 +14,5 @@
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.search.SearchCompiler.InDataSourceArea;
+import org.openstreetmap.josm.actions.search.SearchCompiler.NotOutsideDataSourceArea;
 import org.openstreetmap.josm.command.Command;
 import org.openstreetmap.josm.command.DeleteCommand;
@@ -39,5 +39,5 @@
 public class Test extends AbstractVisitor {
 
-    protected static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new InDataSourceArea(false);
+    protected static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new NotOutsideDataSourceArea();
 
     /** Name of the test */
