Avoid infinite loop in web ui when pipeline has loops

Signed-off-by: Richard Bradley <Richard.Bradley@softwire.com>
This commit is contained in:
Richard Bradley 2019-11-08 14:28:11 +00:00
parent 749db38c3e
commit 935f9d6fa0
1 changed files with 7 additions and 0 deletions

View File

@ -226,6 +226,13 @@ Graph.prototype.computeRanks = function() {
// ranks, so always destination nodes as far to the right as possible
nextNode._cachedRank = Math.max(nextNode._cachedRank, node._cachedRank + 1);
if (nextNode._cachedRank > 10000) {
throw new Error(
"Likely infinite loop involving: [" +
node.id + "] and [" +
nextNode.id + "]");
}
nextNodes[nextNode.id] = nextNode;
}
}