fix: do not try to backup an undefined geojson

This occurs when a remote data returns an invalid geojson.

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-01-31 16:47:17 +01:00
parent 3e9982c8cb
commit e38e0f162c

View file

@ -282,7 +282,9 @@ export class DataLayer extends ServerStored {
}
backupData() {
this._geojson_bk = Utils.CopyJSON(this._geojson)
if (this._geojson) {
this._geojson_bk = Utils.CopyJSON(this._geojson)
}
}
reindex() {