Changeset 14241 in josm


Ignore:
Timestamp:
2018-09-10T00:35:14+02:00 (2 weeks ago)
Author:
Don-vip
Message:

fix #16714 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/relation/DuplicateRelationAction.java

    r13957 r14241  
    5252    }
    5353
     54    private static boolean isEditableRelation(IRelation<?> r) {
     55        return r instanceof Relation && r.getDataSet() != null && !r.getDataSet().isLocked();
     56    }
     57
    5458    @Override
    5559    protected void updateEnabledState() {
    5660        // only one selected relation can be edited
    5761        setEnabled(relations.size() == 1
    58                 && relations.iterator().next() instanceof Relation
    59                 && !relations.iterator().next().getDataSet().isLocked());
     62                && isEditableRelation(relations.iterator().next()));
    6063    }
    6164}
Note: See TracChangeset for help on using the changeset viewer.