Changeset 4632 in josm for trunk/src/org


Ignore:
Timestamp:
2011-12-04T13:48:18+01:00 (13 years ago)
Author:
Don-vip
Message:

fix #7111 - JOSM crashes when "aligning nodes" is used and only one node is focussed before

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java

    r4558 r4632  
    136136                    // warning
    137137                    return;
    138             } else if(n.isReferredByWays(2) == false) { // node used in only one way
    139                 w = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class).iterator().next();
     138            } else {
     139                List<Way> refWays = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class);
     140                if (refWays.size() == 1) { // node used in only one way
     141                    w = refWays.iterator().next();
     142                }
    140143            }
    141144            if (w == null || w.getNodesCount() < 3)
Note: See TracChangeset for help on using the changeset viewer.