Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java	(revision 34221)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceMembershipAction.java	(revision 34263)
@@ -43,5 +43,5 @@
 
         final ReplaceGeometryCommand command = getReplaceGeometryCommand(firstObject, secondObject);
-        final int affectedRelations = command.getChildren().size();
+        final int affectedRelations = command != null ? command.getChildren().size() : 0;
         if (affectedRelations > 0) {
             MainApplication.undoRedo.add(command);
@@ -75,5 +75,5 @@
         }
 
-        return new ReplaceGeometryCommand(tr("Replace Membership"), commands);
+        return commands.isEmpty() ? null : new ReplaceGeometryCommand(tr("Replace Membership"), commands);
     }
 
