Fix: add new items works again, fix #1593

This commit is contained in:
Pieter Vander Vennet 2023-09-27 22:38:30 +02:00
parent 7ace25d377
commit c527427f70
2 changed files with 1 additions and 4 deletions

View file

@ -19,9 +19,6 @@ export default abstract class OsmChangeAction {
constructor(mainObjectId: string, trackStatistics: boolean = true) {
this.trackStatistics = trackStatistics
this.mainObjectId = mainObjectId
if(mainObjectId === undefined || mainObjectId === null){
throw "OsmObject received '"+mainObjectId+"' as mainObjectId"
}
}
public async Perform(changes: Changes) {

View file

@ -102,7 +102,7 @@
console.log("Creating new point at", location, "snapped to", snapTo, "with tags", tags);
let snapToWay: undefined | OsmWay = undefined;
if (snapTo !== undefined) {
if (snapTo !== undefined && snapTo !== null) {
const downloaded = await state.osmObjectDownloader.DownloadObjectAsync(snapTo, 0);
if (downloaded !== "deleted") {
snapToWay = downloaded;