JenkinsServer::getBuild fails when there isn't an executable section yet

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor
    • Component/s: java-client-api
    • None

      An NPE is thrown when JenkinsServer::getBuild doesn't have a build currently kicked off

       

      java.lang.NullPointerException
          at com.offbytwo.jenkins.JenkinsServer.getBuild(JenkinsServer.java:810)
          at com.offbytwo.jenkins.JenkinsServer$getBuild$3.call(Unknown Source)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
          at ideaGroovyConsole.run(ideaGroovyConsole.groovy:64)
          at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)
          at groovy.lang.GroovyShell.run(GroovyShell.java:518)
          at groovy.lang.GroovyShell.run(GroovyShell.java:497)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       

      Happens on the line:

      String url = q.getExecutable().getUrl();

       

       

       

       

       

            Assignee:
            Karl-Heinz Marbaise
            Reporter:
            Steven Hicks
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: