Changeset 18218 in josm for trunk/src


Ignore:
Timestamp:
2021-09-12T03:30:18+02:00 (3 years ago)
Author:
Don-vip
Message:

coverity - fix potential NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java

    r18174 r18218  
    8585     */
    8686    private void saveHistory() {
    87         model.addTopElement(SearchSetting.fromString(hcbSearchString.getText()));
     87        Optional.ofNullable(SearchSetting.fromString(hcbSearchString.getText()))
     88            .ifPresent(model::addTopElement);
    8889        prefs.save(OVERPASS_WIZARD_HISTORY);
    8990    }
Note: See TracChangeset for help on using the changeset viewer.