Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4182

NullPointerException in DefaultUrlHelper

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.1
    • Fix Version/s: 2.3.16
    • Component/s: Core Actions
    • Labels:
      None

      Description

      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:

      link.append(buildParameterSubstring(name, paramValue.toString()));
      

      For null parameters an empty string is written to the url:

      value != null ? value.toString() : StringUtils.EMPTY
      

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

        Attachments

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              thomasgo Thomas Goettlich
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified