-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add capability to walk through 'link' nodes and avoid crash when newNode is null #61
Comments
I'm running into this same issue with the As Aurelien noted, the logic does not allow for flows that pass through a pair of Secondly, the wires are only followed if they are connected to the first output port -- due to this code:
Instead, the list of downstream nodes needs to be a concatenation of all the output wires, with any "link" ids. The bigger issue is the runtime exception which causes the swagger sidebar rendering to fail. This is caused by Here is a more robust version of that function, which I've been using locally for a while:
Please let me know if you want me to open a PR, or if you have all you need. |
@shrickus this is a very unloved node that hasn't had any changes in 3 years. I'm unlikely to spend any time on it given all of the higher priority work on the core of Node-RED. So if you wanted to raise a PR with all the fixes, then it would be very welcome. |
#67 has been merged that should address this issue - version 0.1.9 of the node published to npm. |
changing the function in swagger.js by this will add the two capabilities
function checkWiresForHttpResponse(node) {
var wires = node.wires[0];
// Add link following
if (wires === undefined || wires.length == 0) {
wires = node.links; // in case this links are in use on the scenario
}
for (var i in wires) {
var newNode = RED.nodes.getNode(wires[i]);
if (newNode === null) {
// in case newNode is null will avoid process to crash
return false;
}
if (newNode.type == "http response") {
return true;
} else if (checkWiresForHttpResponse(newNode)) {
return true;
}
}
return false;
}
The text was updated successfully, but these errors were encountered: