Changeset 18804 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2023-08-13T00:20:18+02:00 (11 months ago)
Author:
taylor.smock
Message:

Fix #23116: Adding a member to a newly created relation will cause an NPE

This was caused by returning a null relation for a new relation.

File:
1 edited

Legend:

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

    r18801 r18804  
    189189            @Override
    190190            public Collection<OsmPrimitive> getSelection() {
     191                // Creating a new relation will open the window. The relation, in that case, will be null.
     192                if (getRelation() == null) {
     193                    Relation relation = new Relation();
     194                    tagEditorPanel.getModel().applyToPrimitive(relation);
     195                    memberTableModel.applyToRelation(relation);
     196                    return Collections.singletonList(relation);
     197                }
    191198                return Collections.singletonList(getRelation());
    192199            }
Note: See TracChangeset for help on using the changeset viewer.