You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2009/09/28 18:50:22 UTC

svn commit: r819639 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java

Author: musachy
Date: Mon Sep 28 16:50:21 2009
New Revision: 819639

URL: http://svn.apache.org/viewvc?rev=819639&view=rev
Log:
prevent NPE when value is null

Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java?rev=819639&r1=819638&r2=819639&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java Mon Sep 28 16:50:21 2009
@@ -36,6 +36,7 @@
 
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsConstants;
+import org.apache.commons.lang.xwork.StringUtils;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.inject.Container;
@@ -234,7 +235,7 @@
                             link.append(paramSeparator);
                     }
                 } else {
-                    link.append(buildParameterSubstring(name, value.toString()));
+                    link.append(buildParameterSubstring(name, value != null ? value.toString() : StringUtils.EMPTY));
                 }
 
                 if (iter.hasNext())