Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22990

NPE from PluginManager.isInstalled

XMLWordPrintable

      A test @kohsuke wrote using @WithPlugins fails with

      java.lang.NullPointerException
      	at org.jenkinsci.test.acceptance.po.PluginManager.isInstalled(PluginManager.java:78)
      	at org.jenkinsci.test.acceptance.po.PluginManager.installPlugin(PluginManager.java:107)
      	at org.jenkinsci.test.acceptance.junit.WithPlugins$RuleImpl$1.installPlugins(WithPlugins.java:64)
      	at org.jenkinsci.test.acceptance.junit.WithPlugins$RuleImpl$1.evaluate(WithPlugins.java:57)
      	at org.jenkinsci.test.acceptance.junit.JenkinsAcceptanceTestRule$1.evaluate(JenkinsAcceptanceTestRule.java:50)
      	at ...
      

      The line of code in question:

      String version = getVersionFromWpValue(n) != null ? getVersionFromWpValue(n) : ucmd.get().plugins.get(n).version;
      

      I am not sure which of ucmd, get(), plugins, or get(...) is null, but if there is something wrong in the environment or test setup, a proper AssertionError should be thrown.

            kohsuke Kohsuke Kawaguchi
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: