You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NullPointerException is thrown unless isRunning() is called first #268
Forgive me if I have missed some config detail that this would resolve, I also did scan through current issues and am not finding anything about this (which is curious to me).
v0.3.7
public static void main(String[] args) {
JenkinsServer jks = new JenkinsServer("https://jenkins.mydomain.com", "username", "token");
// SAD PATH
try {
jks.getVersion();
} catch(Exception e) {
/* java.lang.NullPointerException
* at com.offbytwo.jenkins.JenkinsServer.getVersion(JenkinsServer.java:104)
*/
}
// HAPPY PATH
jks.isRunning();
jks.getVersion();
}
Yeah unfortunately you are right...The point is to get the version there must be at least a single communication happen with the Jenkins server otherwise this information is not set...so this needs to be fixed...Simplest solution would be to call isRunning() inside getVersion()...
Activity
khmarbaise commentedon Jul 20, 2017
Yeah unfortunately you are right...The point is to get the version there must be at least a single communication happen with the Jenkins server otherwise this information is not set...so this needs to be fixed...Simplest solution would be to call
isRunning()insidegetVersion()...Fixed #268