From 48d62bcf8a1f276b3dea8567086b19330e259cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Mon, 15 Nov 2021 12:35:34 +0100 Subject: [PATCH] jsdialog: prevent errors in closePopover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Szymon Kłos Change-Id: Ia2fc78d06b54f0011d168ae769f11cbd137676a0 --- browser/src/control/Control.JSDialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/src/control/Control.JSDialog.js b/browser/src/control/Control.JSDialog.js index 7d22d3c8c..f9f62a5b8 100644 --- a/browser/src/control/Control.JSDialog.js +++ b/browser/src/control/Control.JSDialog.js @@ -53,6 +53,9 @@ L.Control.JSDialog = L.Control.extend({ }, closePopover: function(id, sendCloseEvent) { + if (!id || !this.dialogs[id]) + return; + L.DomUtil.remove(this.dialogs[id].overlay); var clickToClose = this.dialogs[id].clickToClose; var builder = this.clearDialog(id);