Controllo che length esista

master
Pietro Brenna 2020-02-22 12:30:28 +01:00
parent 4e1f900326
commit ef91eec520
1 changed files with 1 additions and 1 deletions

View File

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