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

HockeyAppRecorder.getProjectActions throws NullPointerException

    Details

    • Similar Issues:

      Description

      When getProjectActions is called before current build has a result, it throws a NullPointerException. The following code fails when the current build has no result yet, getResult() returns null:

      Collection<AbstractBuild<?, ?>> predicated = CollectionUtils.select(builds, new Predicate() {
      public boolean evaluate(Object o)

      { return ((AbstractBuild<?, ?>) o).getResult().isBetterOrEqualTo( Result.SUCCESS); }

      });

      Steps to reproduce:
      1. Configure EnvInject plugin to prepare the environment (use the EnvInjectListener)
      2. Add HockeyApp plugin

      EnvInject listener will call getProjectActions before the current build has a result.

        Attachments

          Activity

          Hide
          rayarub Chris Barnes added a comment -

          I've fixed this over here by wrapping the affected code with a null check. I submitted a pull request on GitHub if you want to take the change.

          https://github.com/jenkinsci/hockeyapp-plugin/pull/10

          Show
          rayarub Chris Barnes added a comment - I've fixed this over here by wrapping the affected code with a null check. I submitted a pull request on GitHub if you want to take the change. https://github.com/jenkinsci/hockeyapp-plugin/pull/10
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Chris Barnes
          Path:
          src/main/java/hockeyapp/HockeyappRecorder.java
          http://jenkins-ci.org/commit/hockeyapp-plugin/742e2015ee79938fa6dcf414d99bcf7080bffbc7
          Log:
          JENKINS-17807 Fix NPE on building with certain other plugins installed

          Fixes https://issues.jenkins-ci.org/browse/JENKINS-17807

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Chris Barnes Path: src/main/java/hockeyapp/HockeyappRecorder.java http://jenkins-ci.org/commit/hockeyapp-plugin/742e2015ee79938fa6dcf414d99bcf7080bffbc7 Log: JENKINS-17807 Fix NPE on building with certain other plugins installed Fixes https://issues.jenkins-ci.org/browse/JENKINS-17807
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jerome Lacoste
          Path:
          src/main/java/hockeyapp/HockeyappRecorder.java
          http://jenkins-ci.org/commit/hockeyapp-plugin/8ce67f505756baeef5bd80b4339510ec5d6c87f2
          Log:
          Merge pull request #10 from rayarub/master

          JENKINS-17807 Fix NPE caused by configuration being changed while a build is happening and current build not having a result yet.

          Compare: https://github.com/jenkinsci/hockeyapp-plugin/compare/7473c4c480f0...8ce67f505756

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jerome Lacoste Path: src/main/java/hockeyapp/HockeyappRecorder.java http://jenkins-ci.org/commit/hockeyapp-plugin/8ce67f505756baeef5bd80b4339510ec5d6c87f2 Log: Merge pull request #10 from rayarub/master JENKINS-17807 Fix NPE caused by configuration being changed while a build is happening and current build not having a result yet. Compare: https://github.com/jenkinsci/hockeyapp-plugin/compare/7473c4c480f0...8ce67f505756
          Hide
          lacostej lacostej added a comment -

          Merged

          Show
          lacostej lacostej added a comment - Merged
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Jerome Lacoste
          Path:
          src/main/java/hockeyapp/HockeyappRecorder.java
          http://jenkins-ci.org/commit/hockeyapp-plugin/62bd18ed3e11203f869f771067da2a3dbb741f5a
          Log:
          JENKINS-17807 no need to check for null jobs, just their results

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jerome Lacoste Path: src/main/java/hockeyapp/HockeyappRecorder.java http://jenkins-ci.org/commit/hockeyapp-plugin/62bd18ed3e11203f869f771067da2a3dbb741f5a Log: JENKINS-17807 no need to check for null jobs, just their results

            People

            • Assignee:
              lacostej lacostej
              Reporter:
              nebula Guido van Loon
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: