Skip to content

Commit

Permalink
[Refs JENKINS-12779] Catch invalid build types
Browse files Browse the repository at this point in the history
  • Loading branch information
swestcott committed Mar 20, 2012
1 parent c76cd74 commit ebce082
Showing 1 changed file with 11 additions and 2 deletions.
Expand Up @@ -84,8 +84,17 @@ public final void doBuild(StaplerRequest req, StaplerResponse rsp)
return;
}

BuildAction action = BuildAction.valueOf(buildAction.toUpperCase());
BuildType type = BuildType.valueOf(buildType.toUpperCase());
BuildAction action;
BuildType type;

try {
action = BuildAction.valueOf(buildAction.toUpperCase());
type = BuildType.valueOf(buildType.toUpperCase());
} catch (IllegalArgumentException e) {
rsp.forwardToPreviousPage(req);
return;
}

Builder builder = new Builder(action);

String params = req.getParameter("params");
Expand Down

0 comments on commit ebce082

Please sign in to comment.