提交 78169fa0 编写于 作者: J jglick

Attempting better diagnosis of KENAIPLUGIN-2:

net.sf.json.JSONException: null object
	at net.sf.json.JSONObject.verifyIsNull(JSONObject.java:2418)
	at net.sf.json.JSONObject.has(JSONObject.java:1777)
	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:309)
	at hudson.model.Descriptor.newInstance(Descriptor.java:335)
	at hudson.model.JobPropertyDescriptor.newInstance(JobPropertyDescriptor.java:65)
	at hudson.model.Job.doConfigSubmit(Job.java:915)
	....


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18252 71c3de6d-444a-0410-be80-ed276b4c234a
上级 79b2071c
......@@ -912,7 +912,11 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
for (JobPropertyDescriptor d : JobPropertyDescriptor
.getPropertyDescriptors(Job.this.getClass())) {
String name = "jobProperty" + (i++);
JobProperty prop = d.newInstance(req, json.getJSONObject(name));
JSONObject config = json.getJSONObject(name);
if (config.isNullObject()) {
throw new JSONException("Null parameter " + name + " at index " + i + " working on " + d);
}
JobProperty prop = d.newInstance(req, config);
if (prop != null) {
prop.setOwner(this);
properties.add(prop);
......@@ -942,8 +946,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
} catch (JSONException e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw
.println("Failed to parse form data. Please report this probelm as a bug");
pw.println("Failed to parse form data. Please report this problem as a bug");
pw.println("JSON=" + req.getSubmittedForm());
pw.println();
e.printStackTrace(pw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册