Ignore:
Timestamp:
2016-05-10T16:09:21+02:00 (4 years ago)
Author:
Don-vip
Message:

fix coverity 1354674, 1354675

File:
1 edited

Legend:

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

    r9989 r10174  
    88import java.awt.GridBagLayout;
    99import java.util.ArrayList;
     10import java.util.Arrays;
    1011import java.util.Collection;
    1112import java.util.Collections;
     
    2728import org.openstreetmap.josm.Main;
    2829import org.openstreetmap.josm.actions.SplitWayAction;
     30import org.openstreetmap.josm.actions.SplitWayAction.SplitWayResult;
    2931import org.openstreetmap.josm.data.osm.Node;
    3032import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    470472            return new ChangeCommand(ws.way, wnew);
    471473        } else {
    472             List<List<Node>> chunks = new ArrayList<>(2);
    473             chunks.add(n1);
    474             chunks.add(n2);
    475             return SplitWayAction.splitWay(layer, ws.way, chunks, Collections.<OsmPrimitive>emptyList()).getCommand();
     474            SplitWayResult split = SplitWayAction.splitWay(layer, ws.way, Arrays.asList(n1, n2), Collections.<OsmPrimitive>emptyList());
     475            return split != null ? split.getCommand() : null;
    476476        }
    477477    }
Note: See TracChangeset for help on using the changeset viewer.