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:40:15 +0000 (08:40 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/luci.js

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