Commit a744c0ef authored by Florian Schäfer's avatar Florian Schäfer

Fix #15623 – Check if editDataSet is present before adding wikipedia tag to selected object(s)

git-svn-id: https://svn.openstreetmap.org/applications/editors/josm/plugins/wikipedia@34093 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
parent 39d49979
......@@ -26,6 +26,7 @@ import org.openstreetmap.josm.Main;
import org.openstreetmap.josm.actions.search.SearchAction;
import org.openstreetmap.josm.command.ChangePropertyCommand;
import org.openstreetmap.josm.data.coor.LatLon;
import org.openstreetmap.josm.data.osm.DataSet;
import org.openstreetmap.josm.data.osm.OsmPrimitive;
import org.openstreetmap.josm.data.osm.Tag;
import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent;
......@@ -315,10 +316,11 @@ public class WikipediaToggleDialog extends ToggleDialog implements ActiveLayerCh
}
static void addTag(Tag tag) {
if (tag == null) {
final DataSet editDataSet = MainApplication.getLayerManager().getEditDataSet();
if (tag == null || editDataSet == null) {
return;
}
final Collection<OsmPrimitive> selected = MainApplication.getLayerManager().getEditDataSet().getSelected();
final Collection<OsmPrimitive> selected = editDataSet.getSelected();
if (selected.isEmpty() || !GuiUtils.confirmOverwrite(tag.getKey(), tag.getValue(), selected)) {
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment