Fix NPE issue in Jenkinsfile
This commit is contained in:
parent
7f4cf675ec
commit
a2c161f95d
|
@ -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
|
||||||
}
|
}
|
Loading…
Reference in New Issue