提交 6f5ca618 编写于 作者: K Kohsuke Kawaguchi

be lenient in accepting bogus value

上级 fffef1c4
......@@ -42,12 +42,18 @@ public class GlobalQuietPeriodConfiguration extends GlobalConfiguration {
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
int i=0;
try {
i = Integer.parseInt(json.getString("quietPeriod"));
} catch (NumberFormatException e) {
// fall through
}
try {
// for compatibility reasons, this value is stored in Jenkins
Jenkins.getInstance().setQuietPeriod(json.getInt("quietPeriod"));
Jenkins.getInstance().setQuietPeriod(i);
return true;
} catch (IOException e) {
throw new FormException(e,"quietPeriod");
}
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册