From 63c3b344508a2740f767d50ffd88448fb5b6968d Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Mon, 20 Mar 2023 08:09:24 -0600 Subject: [PATCH] Add support for JOSM r18686 (core now calls the same function, which will result in an IOOBE) Signed-off-by: Taylor Smock --- .../plugins/mapillary/gui/dialog/MapillaryFilterDialog.java | 3 ++- .../josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java index 2b9b314cd..2c2682181 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java @@ -38,6 +38,7 @@ import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; +import org.openstreetmap.josm.data.Version; import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile; import org.openstreetmap.josm.data.osm.INode; import org.openstreetmap.josm.data.osm.IPrimitive; @@ -562,7 +563,7 @@ public void destroy() { if (!destroyed) { super.destroy(); this.destroyable.fireEvent(Destroyable::destroy); - if (MainApplication.getMap() != null) { + if (MainApplication.getMap() != null && Version.getInstance().getVersion() < 18686) { MainApplication.getMap().removeToggleDialog(this); } OrganizationRecord.removeOrganizationListener(this); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java index 8ee7a9710..da98436b8 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java @@ -25,6 +25,7 @@ import javax.swing.JPanel; import javax.swing.SpinnerNumberModel; +import org.openstreetmap.josm.data.Version; import org.openstreetmap.josm.data.osm.DataSelectionListener; import org.openstreetmap.josm.data.osm.INode; import org.openstreetmap.josm.data.osm.OsmPrimitive; @@ -322,7 +323,7 @@ private void selectedImageChanged(@Nullable INode oldImage, @Nullable INode newI public void destroy() { if (!destroyed) { super.destroy(); - if (MainApplication.getMap() != null) + if (MainApplication.getMap() != null && Version.getInstance().getVersion() < 18686) MainApplication.getMap().removeToggleDialog(this); destroyed = true; }