Ignore:
Timestamp:
2019-01-07T19:46:32+01:00 (7 years ago)
Author:
simon04
Message:

see #16874 fix #17180 - NPE in UnGlueAction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesMembershipChoiceDialog.java

    r14654 r14662  
    77import java.util.Collection;
    88import java.util.Objects;
     9import java.util.Optional;
    910
    1011import javax.swing.AbstractButton;
     
    113114    /**
    114115     * Returns the tags choice.
    115      * @return the tags choice (can be null)
     116     * @return the tags choice
    116117     */
    117     public ExistingBothNew getTags() {
    118         return tags.getSelected();
     118    public Optional<ExistingBothNew> getTags() {
     119        return Optional.ofNullable(tags).map(ExistingBothNewChoice::getSelected);
    119120    }
    120121
    121122    /**
    122123     * Returns the memberships choice.
    123      * @return the memberships choice (can be null)
     124     * @return the memberships choice
    124125     */
    125     public ExistingBothNew getMemberships() {
    126         return memberships.getSelected();
     126    public Optional<ExistingBothNew> getMemberships() {
     127        return Optional.ofNullable(memberships).map(ExistingBothNewChoice::getSelected);
    127128    }
    128129
Note: See TracChangeset for help on using the changeset viewer.