-
Bug
-
Resolution: Fixed
-
Minor
-
None
There is an NPE in the readResolve() that gets squashed by the RobustReflectionConverter leading to a partially valid object.
This partially valid object can then have unintended consequences. Better is to make the getter methods defensive about the potential null rather than relying on readResolve() to fix.
Here is one piece of sample data that generates the NPE
<org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty plugin="workflow-multibranch@2.10-SNAPSHOT"> <branch class="jenkins.branch.Branch$Dead" plugin="branch-api@1.12-SNAPSHOT"> <sourceId>::NullSCMSource::</sourceId> <head class="org.jenkinsci.plugins.github_branch_source.BranchSCMHead" plugin="github-branch-source@1.11-SNAPSHOT"> <name>quicker</name> </head> <scm class="hudson.scm.NullSCM"/> <properties class="java.util.concurrent.CopyOnWriteArrayList"> <jenkins.branch.NoTriggerBranchProperty/> </properties> </branch> </org.jenkinsci.plugins.workflow.multibranch.BranchJobProperty>
- links to
Code changed in jenkins
User: Stephen Connolly
Path:
src/test/java/jenkins/branch/BranchTest.java
http://jenkins-ci.org/commit/branch-api-plugin/d13aebad21abcbf1d5defa4845999de92e182d63
Log:
JENKINS-41209Add the test case