diff --git a/core/src/main/java/hudson/model/Hudson.java b/core/src/main/java/hudson/model/Hudson.java index 5c78727a0b..a30487d9f5 100644 --- a/core/src/main/java/hudson/model/Hudson.java +++ b/core/src/main/java/hudson/model/Hudson.java @@ -1575,8 +1575,9 @@ public final class Hudson extends View implements ItemGroup, Node, } private boolean configureDescriptor(StaplerRequest req, JSONObject json, Descriptor d) throws FormException { - // collapse the structure to remain backward compatible with the JSON structure before 1.238 - JSONObject js = json.getJSONObject(d.getJsonSafeClassName()); + // collapse the structure to remain backward compatible with the JSON structure before 1. + String name = d.getJsonSafeClassName(); + JSONObject js = json.has(name) ? json.getJSONObject(name) : new JSONObject(); // if it doesn't have the property, the method returns invalid null object. json.putAll(js); return d.configure(req, js); }