Skip to content

Commit

Permalink
Avoid nullpointexception when cause is null since you can bypass vali…
Browse files Browse the repository at this point in the history
…dations as long as you use groovy api [JENKINS-30220]
  • Loading branch information
Victor Martinez committed Aug 31, 2015
1 parent d1d7a44 commit 2505935
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -104,10 +104,13 @@ public void onOnline(final Computer c, final TaskListener listener) {

@Override
public void onTemporarilyOffline(final Computer c, final OfflineCause cause) {

String causeString = "";
if (cause!=null) {
causeString = cause.toString();
}
getNotification().online(false)
.subject("marked temporarily offline")
.body(cause.toString())
.body(causeString)
.send(c)
;
}
Expand Down

0 comments on commit 2505935

Please sign in to comment.