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: https://git.librecmc.org/?a=commitdiff_plain;h=69445fa25f9a22835ef07378de324097fceffbc4;p=oweals%2Fluci.git luci-base: luci.js: L.dom.data(): gracefully handle non-node argument Signed-off-by: Jo-Philipp Wich (cherry picked from commit 308215ca156212ad2a632b31179c2284a59a8556) --- 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 */