Changeset 18337 in josm for trunk/src


Ignore:
Timestamp:
2021-12-20T14:51:15+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #21682 - don't let runtime exceptions in layer change listeners prevent JOSM from closing (patch by Woazboat, modified)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java

    r18069 r18337  
    269269        if (event.getPreviousActiveLayer() != activeLayer || event.getPreviousDataLayer() != osmDataLayer) {
    270270            for (ActiveLayerChangeListener l : activeLayerChangeListeners) {
    271                 l.activeOrEditLayerChanged(event);
     271                try {
     272                    l.activeOrEditLayerChanged(event);
     273                } catch (RuntimeException e) {
     274                    Logging.logWithStackTrace(Logging.LEVEL_ERROR, "Error in layer change listener", e);
     275                }
    272276            }
    273277        }
Note: See TracChangeset for help on using the changeset viewer.