Fix http in node close wrinkle if cors enabled but not used.

This commit is contained in:
Dave C-J 2014-10-29 18:26:09 +00:00
parent 98b875c4a0
commit a1830def8e
1 changed files with 6 additions and 4 deletions

View File

@ -95,10 +95,12 @@ module.exports = function(RED) {
}
if (RED.settings.httpNodeCors) {
var route = RED.httpNode.route['options'];
for (var j = 0; j<route.length; j++) {
if (route[j].path == this.url) {
route.splice(j,1);
//break;
if (route) {
for (var j = 0; j<route.length; j++) {
if (route[j].path == this.url) {
route.splice(j,1);
//break;
}
}
}
}