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
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();
}
The text was updated successfully, but these errors were encountered:
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()...
o Prevent to produce an NPE if getVersion() called
before the first communication. So we call isRunning()
which makes the first communication and will transfer
http headers which contain the version which will be read
by JenkinsHttpClient.
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
The text was updated successfully, but these errors were encountered: