summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-02-14 08:40:15 +0100
committerJo-Philipp Wich <jo@mein.io>2020-02-14 08:40:15 +0100
commit308215ca156212ad2a632b31179c2284a59a8556 (patch)
tree9bb217796f9e10847b7c32c0219a7c61a9448111
parent888be193bdfd99e6f8f3af9357e5b8f9d67047e2 (diff)
luci-base: luci.js: L.dom.data(): gracefully handle non-node argument
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/luci.js3
1 files changed, 3 insertions, 0 deletions
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 */