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:
parent
888be193bd
commit
308215ca15
1 changed files with 3 additions and 0 deletions
|
@ -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 */
|
||||||
|
|
Loading…
Reference in a new issue