Ignore:
Timestamp:
2023-09-07T18:20:01+02:00 (14 months ago)
Author:
taylor.smock
Message:

Use DeleteCommand.delete where possible and fix some potential NPEs from its usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java

    r36132 r36134  
    978978
    979979    private void removeAddressInterpolationWay() {
    980 
    981         // Remove way - nodes of the way remain
    982         commandGroup.add(DeleteCommand.delete(Collections.singleton(addrInterpolationWay)));
    983 
    984         // Remove untagged nodes
    985         for (int i = 1; i < addrInterpolationWay.getNodesCount()-1; i++) {
    986             Node testNode = addrInterpolationWay.getNode(i);
    987             if (!testNode.hasKeys()) {
    988                 commandGroup.add(DeleteCommand.delete(Collections.singleton(testNode)));
    989             }
     980        final Command deleteCommand = DeleteCommand.delete(Collections.singleton(addrInterpolationWay), true);
     981        if (deleteCommand != null) {
     982            commandGroup.add(deleteCommand);
    990983        }
    991984
Note: See TracChangeset for help on using the changeset viewer.