fix persistable context handling of sort node & existing error in testcases

This commit is contained in:
Hiroyasu Nishiyama
2018-09-05 22:29:20 +09:00
committed by Nick O'Leary
parent a2d03c14ae
commit 6fa8b7f5f1
2 changed files with 80 additions and 21 deletions

View File

@@ -196,9 +196,10 @@ module.exports = function(RED) {
}).catch(err => {
node.error(err,msg);
});
return;
}
var parts = msg.parts;
if (!parts.hasOwnProperty("id") || !parts.hasOwnProperty("index")) {
if (!parts || !parts.hasOwnProperty("id") || !parts.hasOwnProperty("index")) {
return;
}
var gid = parts.id;
@@ -242,7 +243,8 @@ module.exports = function(RED) {
delete pending[key];
}
}
pending_count = 0; })
pending_count = 0;
});
}
RED.nodes.registerType("sort", SortNode);