Changeset 15678 in josm


Ignore:
Timestamp:
2020-01-10T23:04:42+01:00 (5 years ago)
Author:
Don-vip
Message:

fix #18545 - NPE

File:
1 edited

Legend:

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

    r13564 r15678  
    66import java.awt.BorderLayout;
    77import java.awt.FlowLayout;
     8import java.awt.Rectangle;
    89import java.awt.event.ActionEvent;
    910import java.awt.event.MouseAdapter;
     
    6667            public void mouseClicked(MouseEvent e) {
    6768                if (e.getClickCount() == 2
    68                     && !e.isAltDown() && !e.isAltGraphDown() && !e.isControlDown() && !e.isMetaDown() && !e.isShiftDown()
    69                     && referrers.getCellBounds(referrers.getSelectedIndex(), referrers.getSelectedIndex()).contains(e.getPoint())) {
    70                     editAction.actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, null));
     69                    && !e.isAltDown() && !e.isAltGraphDown() && !e.isControlDown() && !e.isMetaDown() && !e.isShiftDown()) {
     70                    Rectangle cellBounds = referrers.getCellBounds(referrers.getSelectedIndex(), referrers.getSelectedIndex());
     71                    if (cellBounds != null && cellBounds.contains(e.getPoint())) {
     72                        editAction.actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, null));
     73                    }
    7174                }
    7275            }
     
    8689    }
    8790
     91    /**
     92     * Initializes the model with layer data.
     93     */
    8894    public void init() {
    8995        model.populate(getLayer().data);
Note: See TracChangeset for help on using the changeset viewer.