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:
Oleg Nenashev committed 2014-06-27 08:17:17 +04:00
commit 5ab3742d52
1 file changed
+6 -1
+6 -1
View File
@@ -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);