Skip to content
Permalink
Browse files

Avoid nullpointexception when cause is null since you can bypass vali…

…dations as long as you use groovy api [JENKINS-30220]
  • Loading branch information
Victor Martinez
Victor Martinez committed Aug 31, 2015
1 parent d1d7a44 commit 2505935ae40b2cb06f6568319c8532a1b2718c89
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/main/java/org/jenkinsci/plugins/mailwatcher/WatcherComputerListener.java
@@ -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)
;
}

0 comments on commit 2505935

Please sign in to comment.
You can’t perform that action at this time.