Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 5739)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java	(revision 5740)
@@ -1082,5 +1082,4 @@
         protected abstract Bounds getBounds();
         protected final boolean all;
-        protected final Bounds bounds;
 
         /**
@@ -1089,5 +1088,4 @@
         public InArea(boolean all) {
             this.all = all;
-            this.bounds = getBounds();
         }
 
@@ -1096,7 +1094,8 @@
             if (!osm.isUsable())
                 return false;
-            else if (osm instanceof Node)
-                return bounds.contains(((Node) osm).getCoor());
-            else if (osm instanceof Way) {
+            else if (osm instanceof Node) {
+                Bounds bounds = getBounds();
+                return bounds != null && bounds.contains(((Node) osm).getCoor());
+            } else if (osm instanceof Way) {
                 Collection<Node> nodes = ((Way) osm).getNodes();
                 return all ? forallMatch(nodes) : existsMatch(nodes);
@@ -1135,4 +1134,7 @@
         @Override
         protected Bounds getBounds() {
+            if (Main.map == null || Main.map.mapView == null) {
+                return null;
+            }
             return Main.map.mapView.getRealBounds();
         }
