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

NullPointerException in DefaultUrlHelper

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.15.1
    • 2.3.16
    • Core Actions
    • 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

            lukaszlenart Lukasz Lenart
            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