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:
Wesley Wannemacher
2009-06-02 17:26:17 +00:00
parent 4f91ad5ecb
commit 6862e2a5c5
@@ -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;