Controllo anche il null

master
Pietro Brenna 2020-02-22 12:33:43 +01:00
parent ef91eec520
commit d97866933e
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ module.exports = function (RED) {
let n_matches = 0; let n_matches = 0;
for (let r of this.rules) { for (let r of this.rules) {
let matches = check_rule(r, token); let matches = check_rule(r, token);
if (matches === true || (matches.length && matches.length > 0)) { if (matches === true || (matches != null && matches.length && matches.length > 0)) {
if (matches.length > 0) { if (matches.length > 0) {
msg.regex_matches[r.match_name] = matches; msg.regex_matches[r.match_name] = matches;
} }