AbstractBuild#getEnvironment returns NPE if build isn't running

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      This relates to JENKINS-7915. I can workaround the problem in clearcase plugin, but I believe this should be fixed in core.
      Thing is, AbstractBuild#getEnvironment relies on Run#getEnvironment which retrieves the computer the build occurs using

      Computer.currentComputer()

      However, it only works if the current thread is an executor, that is, only if the build is running. In AbstractBuild, using getBuiltOn().toComputer(), we can actually retrieve a valid reference for the computer the build executed even if it isn't running anymore.

        1. HUDSON-7939.patch
          2 kB
          Vincent Latombe

            Assignee:
            Kohsuke Kawaguchi
            Reporter:
            Vincent Latombe
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: