From c985cb3de562ce6cf8c9675e5b6c8b576d3ff380 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 4 Feb 2025 17:40:49 +0100 Subject: [PATCH] fix: error after deleting a path that was previously moved When moving a path, this will put a once time listener on "moveend". If we delete this feature, and move the map, we should not execute the event callback. A better fix would be to cancel the event listener on delete, but that is much more work given how we deal with Leaflet events right now. --- umap/static/umap/js/modules/rendering/ui.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index 92486c4f..247b3000 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -267,6 +267,8 @@ const PathMixin = { }, makeGeometryEditable: function () { + // Feature has been removed since then? + if (!this._map) return if (this._map._umap.editedFeature !== this.feature) { this.disableEdit() return