mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix an error that occurs when evaluating null
on isEmpty
rule.
This commit is contained in:
parent
5148c62d1c
commit
a6a4620374
@ -34,7 +34,7 @@ module.exports = function(RED) {
|
||||
'empty': function(a) {
|
||||
if (typeof a === 'string' || Array.isArray(a) || Buffer.isBuffer(a)) {
|
||||
return a.length === 0;
|
||||
} else if (typeof a === 'object') {
|
||||
} else if (typeof a === 'object' && a !== null) {
|
||||
return Object.keys(a).length === 0;
|
||||
}
|
||||
return false;
|
||||
@ -42,7 +42,7 @@ module.exports = function(RED) {
|
||||
'nempty': function(a) {
|
||||
if (typeof a === 'string' || Array.isArray(a) || Buffer.isBuffer(a)) {
|
||||
return a.length !== 0;
|
||||
} else if (typeof a === 'object') {
|
||||
} else if (typeof a === 'object' && a !== null) {
|
||||
return Object.keys(a).length !== 0;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user