If an OSM-object does not exist anyore, ignore changes to this object. Fix #577

This commit is contained in:
Pieter Vander Vennet 2021-12-05 05:19:59 +01:00
parent fc70909005
commit 76c84b3972

View file

@ -212,7 +212,13 @@ export class Changes {
private async flushSelectChanges(pending: ChangeDescription[]): Promise<boolean> {
const self = this;
const neededIds = Changes.GetNeededIds(pending)
const osmObjects = await Promise.all(neededIds.map(id => OsmObject.DownloadObjectAsync(id)));
const osmObjects = Utils.NoNull(await Promise.all(neededIds.map(async id =>
OsmObject.DownloadObjectAsync(id).catch(e => {
console.error("Could not download OSM-object", id, " dropping it from the changes")
pending = pending.filter(ch => ch.type + "/" + ch.id !== id)
return undefined;
}))));
if (this._leftRightSensitive) {
osmObjects.forEach(obj => SimpleMetaTagger.removeBothTagging(obj.tags))