Changeset 5932 in josm


Ignore:
Timestamp:
2013-05-06T02:53:50+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #5680 - IndexOutOfBoundsException when resolving a conflict on untagged primitive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java

    r5266 r5932  
    231231    }
    232232
     233    /**
     234     * Constructs a new {@code TagMerger}.
     235     */
    233236    public TagMerger() {
    234237        model = new TagMergeModel();
     
    424427    public void populate(Conflict<? extends OsmPrimitive> conflict) {
    425428        model.populate(conflict.getMy(), conflict.getTheir());
    426         mineTable.getSelectionModel().setSelectionInterval(0, 0);
    427         theirTable.getSelectionModel().setSelectionInterval(0, 0);
     429        for (JTable table : new JTable[]{mineTable, theirTable}) {
     430            int index = table.getRowCount() > 0 ? 0 : -1;
     431            table.getSelectionModel().setSelectionInterval(index, index);
     432        }
    428433    }
    429434}
Note: See TracChangeset for help on using the changeset viewer.