Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 7713)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 7714)
@@ -947,5 +947,5 @@
      */
     public OsmPrimitive getPrimitiveById(PrimitiveId primitiveId) {
-        return primitivesMap.get(primitiveId);
+        return primitiveId != null ? primitivesMap.get(primitiveId) : null;
     }
 
@@ -957,5 +957,5 @@
     private OsmPrimitive getPrimitiveByIdChecked(PrimitiveId primitiveId) {
         OsmPrimitive result = getPrimitiveById(primitiveId);
-        if (result == null) {
+        if (result == null && primitiveId != null) {
             Main.warn(tr("JOSM expected to find primitive [{0} {1}] in dataset but it is not there. Please report this "
                     + "at {2}. This is not a critical error, it should be safe to continue in your work.",
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 7713)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 7714)
@@ -475,11 +475,11 @@
 
             // This will cycle through the available items.
-            if(firstSelected == null) {
-                ds.addSelected(firstItem);
-            } else {
+            if (firstSelected != null) {
                 ds.clearSelection(firstSelected);
                 if(nextSelected != null) {
                     ds.addSelected(nextSelected);
                 }
+            } else if (firstItem != null) {
+                ds.addSelected(firstItem);
             }
         }
