From 0c1c5f117d6d520a251f100a850cb4382e161b5d Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 17 Apr 2024 11:10:40 +0200 Subject: [PATCH] fix: do not try to close editPanel if not set When in the user dashboard and opening a map preview, when we press escape it will try to close non existing panels (they are not instantiated given there is not edit mode there) --- umap/static/umap/js/umap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 332f8dab..d62f4bba 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -524,8 +524,8 @@ U.Map = L.Map.extend({ this.help.hide() } else { this.panel.close() - this.editPanel.close() - this.fullPanel.close() + this.editPanel?.close() + this.fullPanel?.close() } }