Fixed the form submission error when there's no Ant or Maven configured.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11170 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2008-07-31 23:20:23 +00:00
1 parent c3adfaf74e
commit bd23782e28
1 file changed
+3 -2
+3 -2
View File
@@ -1575,8 +1575,9 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, 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);
}