Changeset 35770 in osm


Ignore:
Timestamp:
2021-05-25T15:47:55+02:00 (3 years ago)
Author:
holgermappt
Message:

Use try/catch instead of flag (which does not work as intended), see #josm20893

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoPropertyEditor.java

    r35767 r35770  
    4242import org.openstreetmap.josm.tools.GBC;
    4343import org.openstreetmap.josm.tools.ImageProvider;
     44import org.openstreetmap.josm.tools.Logging;
    4445
    4546/**
     
    6768     */
    6869    private static class PropertyEditorAction extends JosmAction implements LayerChangeListener, ImageDataUpdateListener {
    69         boolean imgDataUpdLstReg = false;
    7070
    7171        public PropertyEditorAction() {
     
    137137            if (layer instanceof GeoImageLayer) {
    138138                ((GeoImageLayer) layer).getImageData().addImageDataUpdateListener(this);
    139                 imgDataUpdLstReg = true;
    140139            }
    141140        }
     
    149148                // e.g. if the plugin was added while the geo image layer
    150149                // existed and then the layer is removed.
    151                 if (imgDataUpdLstReg) {
     150                try {
    152151                    ((GeoImageLayer) layer).getImageData().removeImageDataUpdateListener(this);
    153                     imgDataUpdLstReg = false;
     152                } catch (IllegalArgumentException ignore) {
     153                    Logging.trace(ignore);
    154154                }
    155155            }
Note: See TracChangeset for help on using the changeset viewer.