Skip to content

Commit

Permalink
Handle case where last completed build does not have RebuildAction
Browse files Browse the repository at this point in the history
  • Loading branch information
sghill committed Dec 5, 2023
1 parent 645b7df commit 67fe5fc
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public String getUrlName() {
final Run<?, ?> lastCompletedBuild = project.getLastCompletedBuild();
if (lastCompletedBuild != null) {
final RebuildAction action = lastCompletedBuild.getAction(RebuildAction.class);
if (action == null) {

Check warning on line 58 in src/main/java/com/sonyericsson/rebuild/RebuildLastCompletedBuildAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 58 is only partially covered, one branch is missing
return null;

Check warning on line 59 in src/main/java/com/sonyericsson/rebuild/RebuildLastCompletedBuildAction.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 59 is not covered by tests
}
// TODO This will have unexpected results if the job configuration changed between link rendering

Check warning on line 61 in src/main/java/com/sonyericsson/rebuild/RebuildLastCompletedBuildAction.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: This will have unexpected results if the job configuration changed between link rendering
// and when the user clicks. Seems preferable to rebuilding a "wrong" build (finished since link was
// rendered though).
Expand Down

0 comments on commit 67fe5fc

Please sign in to comment.