mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
Null check the 'properties' element of the json message before attempting to 'rebuild' the 'DescribableList'
This commit is contained in:
1 parent
aa8f5955cd
commit
b00aeddf4b
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