mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-3107, fixing NPE, good catch Andrey Vasenin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@781086 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -167,17 +167,19 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
}
|
||||
|
||||
ResultConfig resultConfig = invocation.getProxy().getConfig().getResults().get(invocation.getResultCode());
|
||||
Map resultConfigParams = resultConfig.getParams();
|
||||
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext();) {
|
||||
Map.Entry e = (Map.Entry) i.next();
|
||||
if (resultConfig != null ) {
|
||||
Map resultConfigParams = resultConfig.getParams();
|
||||
for (Iterator i = resultConfigParams.entrySet().iterator(); i.hasNext();) {
|
||||
Map.Entry e = (Map.Entry) i.next();
|
||||
|
||||
if (!getProhibitedResultParams().contains(e.getKey())) {
|
||||
requestParameters.put(e.getKey().toString(),
|
||||
e.getValue() == null ? "" :
|
||||
conditionalParse(e.getValue().toString(), invocation));
|
||||
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(), invocation);
|
||||
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
|
||||
requestParameters.put(e.getKey().toString(), potentialValue);
|
||||
if (!getProhibitedResultParams().contains(e.getKey())) {
|
||||
requestParameters.put(e.getKey().toString(),
|
||||
e.getValue() == null ? "" :
|
||||
conditionalParse(e.getValue().toString(), invocation));
|
||||
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(), invocation);
|
||||
if (!supressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
|
||||
requestParameters.put(e.getKey().toString(), potentialValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -232,7 +234,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
/**
|
||||
* Sets the supressEmptyParameters option
|
||||
*
|
||||
* @param suppress The new value for this option
|
||||
* @param supressEmptyParameters The new value for this option
|
||||
*/
|
||||
public void setSupressEmptyParameters(boolean supressEmptyParameters) {
|
||||
this.supressEmptyParameters = supressEmptyParameters;
|
||||
|
||||
Reference in New Issue
Block a user