From 69445fa25f9a22835ef07378de324097fceffbc4 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 (cherry picked from commit 308215ca156212ad2a632b31179c2284a59a8556) --- 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 b281da5e5..dbe251052 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -2520,6 +2520,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