Skip to content

Commit

Permalink
Merge pull request #2 from brenarth/JENKINS-34922
Browse files Browse the repository at this point in the history
Check for null result when resolving incidents
  • Loading branch information
alexanderlz committed Nov 29, 2016
2 parents c795510 + 0675020 commit 6207752
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -222,7 +222,11 @@ private boolean resolveIncident(PagerDuty pagerDuty, PrintStream logger) {
.build();
try{
NotifyResult result = pagerDuty.notify(resolution);
logger.println("Finished resolving - " + result.status());
if (result != null) {
logger.println("Finished resolving - " + result.status());
} else {
logger.println("Attempt to resolve the incident returned null - Incident may already be closed or may not exist.");
}
} catch (IOException e){
logger.println("Error while trying to resolve ");
logger.println(e.getMessage());
Expand Down Expand Up @@ -298,4 +302,4 @@ public String getDisplayName() {
}

}
}
}

0 comments on commit 6207752

Please sign in to comment.