luci-base: luci.js: L.dom.data(): gracefully handle non-node argument
authorJo-Philipp Wich <jo@mein.io>
Fri, 14 Feb 2020 07:40:15 +0000 (08:40 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 14 Feb 2020 07:46:17 +0000 (08:46 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 308215ca156212ad2a632b31179c2284a59a8556)

modules/luci-base/htdocs/luci-static/resources/luci.js

index b281da5e5c0275786bea0b483c6e3ff8f7df5b23..dbe2510527a9a2c1c473be21e802a9516797416a 100644 (file)
                         * be found.
                         */
                        data: function(node, key, val) {
+                               if (!node || !node.getAttribute)
+                                       return null;
+
                                var id = node.getAttribute('data-idref');
 
                                /* clear all data */