Ticket #17040: 17040-properties-v2.patch

File 17040-properties-v2.patch, 1.6 KB (added by GerdP, 7 years ago)

Fixed NPE (sel was reset too early)

  • src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

     
    567567    public void selectionChanged(SelectionChangeEvent event) {
    568568        if (!isVisible())
    569569            return;
     570        if (event != null && event.getSelection().isEmpty())
     571            editHelper.resetSel();
    570572        if (tagTable == null)
    571573            return; // selection changed may be received in base class constructor before init
    572574        if (tagTable.getCellEditor() != null) {
     
    707709    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
    708710        if (e.getSource().getEditLayer() == null) {
    709711            editHelper.saveTagsIfNeeded();
     712            editHelper.resetSel();
    710713        }
    711714        // it is time to save history of tags
    712715        updateSelection();
  • src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

     
    367367    }
    368368
    369369    /**
     370     * Forget recently selected primitives to allow GC.
     371     */
     372    public void resetSel() {
     373        sel = null;
     374    }
     375
     376    /**
    370377     * Update cache of recent tags used for displaying tags.
    371378     */
    372379    private void cacheRecentTags() {