Ignore:
Timestamp:
2018-01-13T01:03:44+01:00 (7 years ago)
Author:
donvip
Message:

fix NPE seen in integration tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/eventbus/src/org/openstreetmap/josm/plugins/eventbus/EventBusPlugin.java

    r34000 r34002  
    423423        post(new MapFrameInitializedEvent(this, oldFrame, newFrame));
    424424        if (newFrame != null) {
    425             newFrame.getToggleDialog(LayerListDialog.class).getModel().addLayerListModelListener(layerListModelListener);
     425            LayerListDialog dlg = newFrame.getToggleDialog(LayerListDialog.class);
     426            if (dlg != null) {
     427                dlg.getModel().addLayerListModelListener(layerListModelListener);
     428            }
    426429            newFrame.keyDetector.addKeyListener(keyPressReleaseListener);
    427430            newFrame.keyDetector.addModifierExListener(modifierExListener);
    428431        }
    429432        if (oldFrame != null) {
    430             oldFrame.getToggleDialog(LayerListDialog.class).getModel().removeLayerListModelListener(layerListModelListener);
     433            LayerListDialog dlg = oldFrame.getToggleDialog(LayerListDialog.class);
     434            if (dlg != null) {
     435                dlg.getModel().removeLayerListModelListener(layerListModelListener);
     436            }
    431437            oldFrame.keyDetector.removeKeyListener(keyPressReleaseListener);
    432438            oldFrame.keyDetector.removeModifierExListener(modifierExListener);
Note: See TracChangeset for help on using the changeset viewer.