Changeset 13512 in josm for trunk/src


Ignore:
Timestamp:
2018-03-10T17:47:43+01:00 (20 months ago)
Author:
Don-vip
Message:

fix #16072 - add robustness in ImproveWayAccuracy map mode

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r13434 r13512  
    4949import org.openstreetmap.josm.gui.util.ModifierExListener;
    5050import org.openstreetmap.josm.tools.ImageProvider;
     51import org.openstreetmap.josm.tools.Logging;
    5152import org.openstreetmap.josm.tools.Pair;
    5253import org.openstreetmap.josm.tools.Shortcut;
     
    255256            if (ctrl && candidateSegment != null) {
    256257                g.setStroke(ADD_NODE_STROKE.get());
    257                 p1 = candidateSegment.getFirstNode();
    258                 p2 = candidateSegment.getSecondNode();
     258                try {
     259                    p1 = candidateSegment.getFirstNode();
     260                    p2 = candidateSegment.getSecondNode();
     261                } catch (ArrayIndexOutOfBoundsException e) {
     262                    Logging.error(e);
     263                }
    259264            } else if (!alt && !ctrl && candidateNode != null) {
    260265                g.setStroke(MOVE_NODE_STROKE.get());
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r13493 r13512  
    123123     * @param index the position
    124124     * @return  the node at position <code>index</code>
    125      * @throws IndexOutOfBoundsException if <code>index</code> &lt; 0
     125     * @throws ArrayIndexOutOfBoundsException if <code>index</code> &lt; 0
    126126     * or <code>index</code> &gt;= {@link #getNodesCount()}
    127127     * @since 1862
Note: See TracChangeset for help on using the changeset viewer.