From: Jo-Philipp Wich Date: Fri, 14 Feb 2020 07:40:15 +0000 (+0100) Subject: luci-base: luci.js: L.dom.data(): gracefully handle non-node argument X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=308215ca156212ad2a632b31179c2284a59a8556;p=project%2Fluci.git luci-base: luci.js: L.dom.data(): gracefully handle non-node argument Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 2cb346c81b..8d056ec03d 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 */