You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Thomas Goettlich (JIRA)" <ji...@apache.org> on 2013/08/21 11:06:51 UTC

[jira] [Created] (WW-4182) NullpointerException in DefaultUrlHelper

Thomas Goettlich created WW-4182:
------------------------------------

             Summary: NullpointerException in DefaultUrlHelper
                 Key: WW-4182
                 URL: https://issues.apache.org/jira/browse/WW-4182
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions: 2.3.15.1
            Reporter: Thomas Goettlich


In the method ??DefaultUrlHelper.buildParametersString(...)?? a NullPointerException occurs whenever an array or iterable parameter containing null elements is passed.

The problem seems to be lines 214 and 244, which look the same: 
{code}
link.append(buildParameterSubstring(name, paramValue.toString()));
{code}

For null parameters an empty string is written to the url:
{code}
value != null ? value.toString() : StringUtils.EMPTY
{code}

A fix would be to check ??paramValue?? for null as well, thus allowing arrays or iterables to contain null elements.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira