From 308215ca156212ad2a632b31179c2284a59a8556 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 14 Feb 2020 08:40:15 +0100 Subject: [PATCH] luci-base: luci.js: L.dom.data(): gracefully handle non-node argument Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/luci.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 2cb346c81..8d056ec03 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -2554,6 +2554,9 @@ * be found. */ data: function(node, key, val) { + if (!node || !node.getAttribute) + return null; + var id = node.getAttribute('data-idref'); /* clear all data */ -- 2.25.1