Index: src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(revision 19049)
+++ src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java	(working copy)
@@ -464,7 +464,12 @@
         for (Entry<String, String> entry : values.entrySet()) {
             String key = entry.getKey();
             String value = entry.getValue();
-            List<OsmPrimitive> affectedWays = innerWays.stream().filter(way -> value.equals(way.get(key))).collect(Collectors.toList());
+            List<OsmPrimitive> affectedWays;
+            if ("area".equals(key)) {
+                affectedWays = innerWays.stream().filter(way -> value.equals(way.get(key))).collect(Collectors.toList());
+            } else {
+                affectedWays = new ArrayList<>();
+            }
 
             if (moveTags) {
                 // remove duplicated tags from outer ways
Index: test/data/regress/23641/data.osm
===================================================================
--- test/data/regress/23641/data.osm	(nonexistent)
+++ test/data/regress/23641/data.osm	(working copy)
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' upload='never' generator='JOSM'>
+  <node id='-25355' action='modify' visible='true' lat='52.70525056802' lon='8.2863900479' />
+  <node id='-25357' action='modify' visible='true' lat='52.70663875771' lon='8.28933646476' />
+  <node id='-25358' action='modify' visible='true' lat='52.70450084767' lon='8.29294054842' />
+  <node id='-25362' action='modify' visible='true' lat='52.70563846997' lon='8.28878800161' />
+  <node id='-25363' action='modify' visible='true' lat='52.70628725805' lon='8.28924416778' />
+  <node id='-25364' action='modify' visible='true' lat='52.70512022866' lon='8.29068470374' />
+  <way id='-579' action='modify' visible='true'>
+    <nd ref='-25355' />
+    <nd ref='-25357' />
+    <nd ref='-25358' />
+    <nd ref='-25355' />
+    <tag k='landuse' v='forest' />
+    <tag k='leaf_type' v='needleleaved' />
+  </way>
+  <way id='-585' action='modify' visible='true'>
+    <nd ref='-25362' />
+    <nd ref='-25363' />
+    <nd ref='-25364' />
+    <nd ref='-25362' />
+    <tag k='landuse' v='forest' />
+    <tag k='leaf_type' v='broadleaved' />
+  </way>
+</osm>
Index: test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java
===================================================================
--- test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(revision 19049)
+++ test/unit/org/openstreetmap/josm/actions/CreateMultipolygonActionTest.java	(working copy)
@@ -290,4 +290,27 @@
         assertNull(cmd);
     }
 
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/23641">Bug #23641</a>.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    void testTicket23642() throws Exception {
+        DataSet ds = OsmReader.parseDataSet(TestUtils.getRegressionDataStream(23641, "data.osm"), null);
+        assertEquals(0, ds.getRelations().size());
+        Pair<SequenceCommand, Relation> cmd = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), null);
+        assertNotNull(cmd);
+        cmd.a.executeCommand();
+        assertEquals(1, ds.getRelations().size());
+        Relation mp = ds.getRelations().iterator().next();
+        assertTrue(mp.hasTag("landuse", "forest"));
+        assertTrue(mp.hasTag("leaf_type", "needleleaved"));
+        assertEquals(0, ds.getWays().stream().filter(w -> w.hasTag("leaf_type", "needleleaved")).count());
+        assertEquals(1, ds.getWays().stream().filter(w -> w.hasTag("leaf_type", "broadleaved")).count());
+        assertEquals(1, mp.getMembers().stream()
+                .filter(m -> "inner".equals(m.getRole()) && m.getMember().hasTag("landuse", "forest")).count());
+        Pair<SequenceCommand, Relation> updateCmd = CreateMultipolygonAction.createMultipolygonCommand(ds.getWays(), mp);
+        assertNull(updateCmd);
+    }
+
 }
