prevent nullpointer in SafeParametersAction #222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In Jenkins 1.642 the following NullPointerException happens when pushing an event
SEVERE: Error while performing reaction to 'gitPush' event.
java.lang.NullPointerException
at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:87)
at hudson.plugins.git.util.GitUtils.addEnvironmentContributingActionsValues(GitUtils.java:292)
at hudson.plugins.git.util.GitUtils.getPollEnvironment(GitUtils.java:278)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:599)
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:574)
at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381)
at hudson.scm.SCM.poll(SCM.java:398)
at hudson.model.AbstractProject._poll(AbstractProject.java:1453)
at hudson.model.AbstractProject.poll(AbstractProject.java:1356)
at hudson.plugins.tfs.TeamPushTrigger$Runner.runPolling(TeamPushTrigger.java:109)
at hudson.plugins.tfs.TeamPushTrigger$Runner.run(TeamPushTrigger.java:142)
Later versions of Jenkins have deprecated buildEnvVars and also check for a NullPointer to prevent this.
Tracking it down shows the problem is ParemtersAction this.paremters is null. SafeParametersAction was not correctly calling its parent constructor to pass in the parameters list.