Handle null return from Function node in array of messages

This commit is contained in:
Nick O'Leary
2016-06-06 11:40:02 +01:00
parent ea76c18f59
commit 3959fcdc88
3 changed files with 45 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2013,2015 IBM Corp.
* Copyright 2013, 2016 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,12 +30,16 @@ module.exports = function(RED) {
if (msgs[m]) {
if (util.isArray(msgs[m])) {
for (var n=0; n < msgs[m].length; n++) {
msgs[m][n]._msgid = _msgid;
msgCount++;
if (msgs[m][n] !== null && msgs[m][n] !== undefined) {
msgs[m][n]._msgid = _msgid;
msgCount++;
}
}
} else {
msgs[m]._msgid = _msgid;
msgCount++;
if (msgs[m] !== null && msgs[m] !== undefined) {
msgs[m]._msgid = _msgid;
msgCount++;
}
}
}
}