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

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

Location:
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/ReconstructPolygonAction.java

    r36132 r36134  
    174174                                candidateWay = tmp;
    175175                            }
    176                             commands.add(DeleteCommand.delete(Collections.singleton(w)));
     176                            final Command deleteCommand = DeleteCommand.delete(Collections.singleton(w));
     177                            if (deleteCommand != null) {
     178                                commands.add(deleteCommand);
     179                            }
    177180                        }
    178181                    }
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/TheRing.java

    r36132 r36134  
    399399        }
    400400        if (!foundOwnWay) {
    401             commands.add(DeleteCommand.delete(Collections.singleton(source)));
     401            final Command deleteCommand = DeleteCommand.delete(Collections.singleton(source));
     402            if (deleteCommand != null) {
     403                commands.add(deleteCommand);
     404            }
    402405        }
    403406        commands.addAll(relationCommands);
Note: See TracChangeset for help on using the changeset viewer.