Skip to content

Commit

Permalink
work around potential null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Jones committed Sep 3, 2018
1 parent 571fc2c commit 896d525
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ void onCompleted(BitbucketCause cause, Result result, String buildUrl) {
return;
}
JenkinsLocationConfiguration globalConfig = JenkinsLocationConfiguration.get();
String rootUrl = globalConfig.getUrl();
if (rootUrl == null) {
if (null!= globalConfig && globalConfig.getUrl() == null) {
logger.warning("PLEASE SET JENKINS ROOT URL IN GLOBAL CONFIGURATION FOR BUILD STATE REPORTING");
} else {
buildUrl = rootUrl + buildUrl;
} else if (null!= globalConfig){
buildUrl = globalConfig.getUrl() + buildUrl;
BuildState state = result == Result.SUCCESS ? BuildState.SUCCESSFUL : BuildState.FAILED;
repository.setBuildStatus(cause, state, buildUrl);
}
Expand Down

0 comments on commit 896d525

Please sign in to comment.