luci-base: luci.js: L.dom.data(): gracefully handle non-node argument

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-02-14 08:40:15 +01:00
parent 888be193bd
commit 308215ca15

View file

@ -2554,6 +2554,9 @@
* be found. * be found.
*/ */
data: function(node, key, val) { data: function(node, key, val) {
if (!node || !node.getAttribute)
return null;
var id = node.getAttribute('data-idref'); var id = node.getAttribute('data-idref');
/* clear all data */ /* clear all data */