Skip to content

Commit

Permalink
Add support for JOSM r18686 (core now calls the same function, which …
Browse files Browse the repository at this point in the history
…will result in an IOOBE)

Signed-off-by: Taylor Smock <tsmock@meta.com>
  • Loading branch information
tsmock committed Mar 20, 2023
1 parent b92f8ff commit 63c3b34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 63c3b34

Please sign in to comment.