Index: trunk/src/org/openstreetmap/josm/command/SelectCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/SelectCommand.java	(revision 15323)
+++ trunk/src/org/openstreetmap/josm/command/SelectCommand.java	(revision 15324)
@@ -35,4 +35,6 @@
         if (newSelection == null || newSelection.isEmpty()) {
             this.newSelection = Collections.emptySet();
+        } else if (newSelection.contains(null)) {
+            throw new IllegalArgumentException("null primitive in selection");
         } else {
             this.newSelection = new HashSet<>(newSelection);
