forked from MapComplete/MapComplete
		
	If an OSM-object does not exist anyore, ignore changes to this object. Fix #577
This commit is contained in:
		
							parent
							
								
									fc70909005
								
							
						
					
					
						commit
						76c84b3972
					
				
					 1 changed files with 41 additions and 35 deletions
				
			
		| 
						 | 
					@ -212,7 +212,13 @@ export class Changes {
 | 
				
			||||||
    private async flushSelectChanges(pending: ChangeDescription[]): Promise<boolean> {
 | 
					    private async flushSelectChanges(pending: ChangeDescription[]): Promise<boolean> {
 | 
				
			||||||
        const self = this;
 | 
					        const self = this;
 | 
				
			||||||
        const neededIds = Changes.GetNeededIds(pending)
 | 
					        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) {
 | 
					        if (this._leftRightSensitive) {
 | 
				
			||||||
            osmObjects.forEach(obj => SimpleMetaTagger.removeBothTagging(obj.tags))
 | 
					            osmObjects.forEach(obj => SimpleMetaTagger.removeBothTagging(obj.tags))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue