struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r819639 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/views/util/UrlHelper.java
Date Mon, 28 Sep 2009 16:50:22 GMT
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())



Mime
View raw message