Ignore:
Timestamp:
2020-03-14T13:26:33+01:00 (4 years ago)
Author:
Don-vip
Message:

fix #18928 - fix various crashes with empty ways

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangeCommand.java

    r14283 r16119  
    3232     * @param osm The existing primitive to modify. It must belong to a data set
    3333     * @param newOsm The new primitive
     34     * @throws IllegalArgumentException if sanity checks fail
    3435     */
    3536    public ChangeCommand(OsmPrimitive osm, OsmPrimitive newOsm) {
     
    4243     * @param osm The existing primitive to modify
    4344     * @param newOsm The new primitive
     45     * @throws IllegalArgumentException if sanity checks fail
    4446     * @since 11240
    4547     */
     
    5456        CheckParameterUtil.ensureParameterNotNull(osm, "osm");
    5557        CheckParameterUtil.ensureParameterNotNull(newOsm, "newOsm");
    56         if (newOsm instanceof Way && ((Way) newOsm).getNodesCount() == 0) {
     58        if (newOsm instanceof Way && ((Way) newOsm).isEmpty()) {
    5759            // Do not allow to create empty ways (see #7465)
    5860            throw new IllegalArgumentException(tr("New way {0} has 0 nodes", newOsm));
Note: See TracChangeset for help on using the changeset viewer.