Skip to content

Commit

Permalink
JENKINS-44165 Fix possible NullPointerException if pipeline is run fo…
Browse files Browse the repository at this point in the history
…r the first time
  • Loading branch information
tommysdk committed Jun 1, 2017
1 parent b0485a2 commit 34524a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/se/diabol/jenkins/workflow/model/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ private static Status runningStatus(long buildTimestamp, int progress) {

private static int progressOfStage(WorkflowRun build, Stage currentStage) {
Run previousRun = workflowApi.lastFinishedRunFor(Name.of(build));
if (!previousRun.hasStage(currentStage.name)) {
if (previousRun == null || !previousRun.hasStage(currentStage.name)) {
return 99;
}

Expand Down

0 comments on commit 34524a6

Please sign in to comment.