Return-Path: Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: (qmail 5980 invoked from network); 2 Jun 2009 17:26:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jun 2009 17:26:28 -0000 Received: (qmail 14156 invoked by uid 500); 2 Jun 2009 17:26:40 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 14080 invoked by uid 500); 2 Jun 2009 17:26:40 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 14071 invoked by uid 99); 2 Jun 2009 17:26:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 17:26:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Jun 2009 17:26:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EB3DE23888CB; Tue, 2 Jun 2009 17:26:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r781086 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java Date: Tue, 02 Jun 2009 17:26:17 -0000 To: commits@struts.apache.org From: wesw@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090602172617.EB3DE23888CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wesw Date: Tue Jun 2 17:26:17 2009 New Revision: 781086 URL: http://svn.apache.org/viewvc?rev=781086&view=rev Log: WW-3107, fixing NPE, good catch Andrey Vasenin Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java?rev=781086&r1=781085&r2=781086&view=diff ============================================================================== --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/ServletRedirectResult.java Tue Jun 2 17:26:17 2009 @@ -167,17 +167,19 @@ } 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 (!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 (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); + } } } } @@ -232,7 +234,7 @@ /** * 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;