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

fix coverity 1354674, 1354675

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

Legend:

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

    r10043 r10174  
    959959                    Collections.<OsmPrimitive>emptyList(), SplitWayAction.Strategy.keepFirstChunk());
    960960
    961             //execute the command, we need the results
    962             cmds.add(split.getCommand());
    963             commitCommands(marktr("Split ways into fragments"));
    964 
    965             result.add(split.getOriginalWay());
    966             result.addAll(split.getNewWays());
    967         } else {
     961            if (split != null) {
     962                //execute the command, we need the results
     963                cmds.add(split.getCommand());
     964                commitCommands(marktr("Split ways into fragments"));
     965
     966                result.add(split.getOriginalWay());
     967                result.addAll(split.getNewWays());
     968            }
     969        }
     970        if (result.isEmpty()) {
    968971            //nothing to split
    969972            result.add(way);
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r10131 r10174  
    746746    public static SplitWayResult split(OsmDataLayer layer, Way way, List<Node> atNodes, Collection<? extends OsmPrimitive> selection) {
    747747        List<List<Node>> chunks = buildSplitChunks(way, atNodes);
    748         if (chunks == null) return null;
    749         return splitWay(layer, way, chunks, selection);
     748        return chunks != null ? splitWay(layer, way, chunks, selection) : null;
    750749    }
    751750
Note: See TracChangeset for help on using the changeset viewer.