From e38e0f162ce9cc6f99eb697188ecbb8bb716bb08 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 31 Jan 2025 16:47:17 +0100 Subject: [PATCH] fix: do not try to backup an undefined geojson This occurs when a remote data returns an invalid geojson. Co-authored-by: David Larlet --- umap/static/umap/js/modules/data/layer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 12086c1a..627f2081 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -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() {