Fix NPE issue in Jenkinsfile

This commit is contained in:
Christian Beikov 2022-04-12 11:15:26 +02:00
parent 7f4cf675ec
commit a2c161f95d
1 changed files with 7 additions and 0 deletions

7
Jenkinsfile vendored
View File

@ -369,5 +369,12 @@ void handleNotifications(currentBuild, buildEnv) {
String getParallelResult( RunWrapper build, String parallelBranchName ) { String getParallelResult( RunWrapper build, String parallelBranchName ) {
def visitor = new PipelineNodeGraphVisitor( build.rawBuild ) def visitor = new PipelineNodeGraphVisitor( build.rawBuild )
def branch = visitor.pipelineNodes.find{ it.type == FlowNodeWrapper.NodeType.PARALLEL && parallelBranchName == it.displayName } def branch = visitor.pipelineNodes.find{ it.type == FlowNodeWrapper.NodeType.PARALLEL && parallelBranchName == it.displayName }
if ( branch == null ) {
echo "Couldn't find parallel branch name '$parallelBranchName'. Available parallel branch names:"
visitor.pipelineNodes.findAll{ it.type == FlowNodeWrapper.NodeType.PARALLEL }.each{
echo " - ${it.displayName}"
}
return null;
}
return branch.status.result return branch.status.result
} }