Skip to content

Commit

Permalink
TRUNK-3970: Fix NPE
Browse files Browse the repository at this point in the history
(cherry picked from commit 96fb5b0)
  • Loading branch information
LeeBreisacher authored and dkayiwa committed Jun 27, 2013
1 parent 3eb8123 commit 4ceecfb
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -58,6 +58,7 @@ public class SchedulerFormController extends SimpleFormController {
* @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest,
* org.springframework.web.bind.ServletRequestDataBinder)
*/
@Override
protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) throws Exception {
super.initBinder(request, binder);
//NumberFormat nf = NumberFormat.getInstance(new Locale("en_US"));
Expand Down Expand Up @@ -119,6 +120,7 @@ protected ModelAndView processFormSubmission(HttpServletRequest request, HttpSer
* @should not reschedule a task that is not currently scheduled
* @should not reschedule a task if the start time has passed
*/
@Override
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command,
BindException errors) throws Exception {

Expand Down Expand Up @@ -155,6 +157,7 @@ protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse
*
* @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
*/
@Override
protected Object formBackingObject(HttpServletRequest request) throws ServletException {

TaskDefinition task = new TaskDefinition();
Expand Down Expand Up @@ -183,8 +186,11 @@ protected Map<String, String> referenceData(HttpServletRequest request, Object c
TaskDefinition task = (TaskDefinition) command;

Long interval = task.getRepeatInterval();
if (interval == null) {
interval = (long) 60;
}
Long repeatInterval;
if (interval == null || interval < 60) {
if (interval < 60) {
map.put("units", "seconds");
repeatInterval = interval;
} else if (interval < 3600) {
Expand Down

0 comments on commit 4ceecfb

Please sign in to comment.