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

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 308215ca15)
This commit is contained in:
Jo-Philipp Wich 2020-02-14 08:40:15 +01:00
parent 2665c5fef8
commit 69445fa25f

View file

@ -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 */