Source:
<code>public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty( ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } Set<ParameterValue> mergedValues = ImmutableSortedSet.copyOf(new Comparator<ParameterValue>() { @Override public int compare(ParameterValue o1, ParameterValue o2) { return o1.getName().compareTo(o2.getName()); } <START> }, Iterables.concat(values, paramAction.getParameters())); <END> List<Action> actions = constructRebuildCause(build, new ParametersAction(Lists.newArrayList(mergedValues))); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }</code><technical_language>check for null accessing paramAction</technical_language>

Target:
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty( ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } Set<ParameterValue> mergedValues = ImmutableSortedSet.copyOf(new Comparator<ParameterValue>() { @Override public int compare(ParameterValue o1, ParameterValue o2) { return o1.getName().compareTo(o2.getName()); } }, Iterables.concat(values, paramAction == null ? new ArrayList<ParameterValue>() : paramAction.getParameters())); List<Action> actions = constructRebuildCause(build, new ParametersAction(Lists.newArrayList(mergedValues))); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }