-
Bug
-
Resolution: Incomplete
-
Minor
-
None
When somebody creates a property in API and occasionally triggers the startTriggers() method, Trigger#start(owner, bool) gets invoked with null argument, which violates the contract and causes NPE.
java.lang.NullPointerException at hudson.triggers.Trigger.start(Trigger.java:94) at org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty.startTriggers(PipelineTriggersJobProperty.java:103) at .... (whatever code)
I think this NPE should be prevented, because such behavior is not documented in the class Javadoc, and hence API users may expect a robust behavior.
I have hit it in one of the proprietary Job templating engines, but actually it is a valid case reproducible via a simple test (see below).
public void triggerMethodsShouldNotThrowNPEWhenNotAssigned() { MockTrigger t = new MockTrigger(); PipelineTriggersJobProperty prop = new PipelineTriggersJobProperty(Arrays.asList(t)); prop.startTriggers(true); }
- duplicates
-
JENKINS-42446 Workflow Job does not call Trigger.start() when job is created
- Resolved
- relates to
-
JENKINS-38454 NPE thrown while configuring github pull request trigger on a pipeline
- Resolved
-
JENKINS-34005 Make WorkflowJob.triggers into a JobProperty
- Resolved
- links to