Changeset 6030 in josm for trunk


Ignore:
Timestamp:
2013-06-26T20:53:47+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #8822 - Don't try to fix empty errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/TestError.java

    r5925 r6030  
    132132     */
    133133    public Collection<? extends OsmPrimitive> getSelectablePrimitives() {
    134     List<OsmPrimitive> selectablePrimitives = new ArrayList<OsmPrimitive>(primitives.size());
    135     for (OsmPrimitive o : primitives) {
    136         if (o.isSelectable()) {
    137         selectablePrimitives.add(o);
    138         }
    139     }
     134        List<OsmPrimitive> selectablePrimitives = new ArrayList<OsmPrimitive>(primitives.size());
     135        for (OsmPrimitive o : primitives) {
     136            if (o.isSelectable()) {
     137                selectablePrimitives.add(o);
     138            }
     139        }
    140140        return selectablePrimitives;
    141141    }
    142 
    143142
    144143    /**
     
    146145     * @param primitives the list of primitives affected by this error
    147146     */
    148 
    149147    public void setPrimitives(List<OsmPrimitive> primitives) {
    150148        this.primitives = primitives;
     
    244242     */
    245243    public Command getFix() {
    246         if (tester == null || !tester.isFixable(this))
     244        if (tester == null || !tester.isFixable(this) || primitives.isEmpty())
    247245            return null;
    248246
Note: See TracChangeset for help on using the changeset viewer.