gitlab-plugin
gitlab-plugin copied to clipboard
Fix an NPE in certain declarative pipelines
Fixes a NullPointerException that can occur on declarative pipelines using triggers options but neglecting to pass a value for the branchFilterType option.
Resolves the following observed NPE (taken from Jenkins logs):
Error while serving https://xyz.abc.aws.com/project/my-project
java.lang.NullPointerException
at com.dabsquared.gitlabjenkins.trigger.filter.BranchFilterFactory.newBranchFilter(BranchFilterFactory.java:15)
at com.dabsquared.gitlabjenkins.GitLabPushTrigger.initializeBranchFilter(GitLabPushTrigger.java:492)
at com.dabsquared.gitlabjenkins.GitLabPushTrigger.onPost(GitLabPushTrigger.java:448)
at com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction$1.performOnPost(MergeRequestBuildAction.java:78)
at com.dabsquared.gitlabjenkins.webhook.build.BuildWebHookAction$TriggerNotifier.run(BuildWebHookAction.java:54)
at hudson.security.ACL.impersonate(ACL.java:350)
at com.dabsquared.gitlabjenkins.webhook.build.MergeRequestBuildAction.execute(MergeRequestBuildAction.java:75)
at com.dabsquared.gitlabjenkins.webhook.build.BuildWebHookAction.execute(BuildWebHookAction.java:31)
at com.dabsquared.gitlabjenkins.webhook.GitLabWebHook.getDynamic(GitLabWebHook.java:44)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
....
18 monthes later ...
facing same issue. At least a workaround exists or still have to bang my head against a brick wall ?
@MarkEWaite Can you please review and merge this? I am running into it.
@MarkEWaite Can you please review and merge this? I am running into it.
@brd have you confirmed that the change fixes your issue and does not have undesirable side effects?
This fix makes a lot of sense to me just by studying the code alone.
@krisstern You’re welcome