mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
Merge pull request #1280 from mattmoor/master
Fix a NPE when the 'properties' element is missing from the form's JSON
This commit is contained in:
commit
5ab3742d52
1 file changed
+6
-1
@@ -1144,7 +1144,12 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
|
||||
logRotator = null;
|
||||
|
||||
DescribableList<JobProperty<?>, JobPropertyDescriptor> t = new DescribableList<JobProperty<?>, JobPropertyDescriptor>(NOOP,getAllProperties());
|
||||
t.rebuild(req,json.optJSONObject("properties"),JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass()));
|
||||
JSONObject jsonProperties = json.optJSONObject("properties");
|
||||
if (jsonProperties != null) {
|
||||
t.rebuild(req,jsonProperties,JobPropertyDescriptor.getPropertyDescriptors(Job.this.getClass()));
|
||||
} else {
|
||||
t.clear();
|
||||
}
|
||||
properties.clear();
|
||||
for (JobProperty p : t) {
|
||||
p.setOwner(this);
|
||||
|
||||
Reference in new issue
Block a user