Changeset 6219 in josm for trunk


Ignore:
Timestamp:
2013-09-06T22:33:35+02:00 (11 years ago)
Author:
Don-vip
Message:

fix NoSuchElementException when purging a way member of a multipolygon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java

    r6162 r6219  
    55import java.awt.geom.Path2D.Double;
    66import java.awt.geom.PathIterator;
    7 import java.awt.geom.Point2D;
    87import java.awt.geom.Rectangle2D;
    98import java.util.ArrayList;
     
    297296                    Way w = (Way) ds.getPrimitiveById(wayIds.iterator().next(), OsmPrimitiveType.WAY);
    298297                    nodes.addAll(w.getNodes());
    299                 } else {
     298                } else if (!wayIds.isEmpty()) {
    300299                    List<Way> waysToJoin = new ArrayList<Way>();
    301300                    for (Long wayId : wayIds) {
     
    305304                        }
    306305                    }
    307                     nodes.addAll(joinWays(waysToJoin).iterator().next().getNodes());
     306                    if (!waysToJoin.isEmpty()) {
     307                        nodes.addAll(joinWays(waysToJoin).iterator().next().getNodes());
     308                    }
    308309                }
    309310                resetPoly();
Note: See TracChangeset for help on using the changeset viewer.