Wicket
  1. Wicket
  2. WICKET-1270

NPE in ListMultipleChoice.updateModel()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-final
    • Fix Version/s: 1.3.1
    • Component/s: wicket
    • Labels:
      None

      Description

      I noticed a NullPointerException when I cleared a Form with a ListMultipleChoice to its original state.
      In updateModel() following statement causes a NPE when something was selected in the multiple select but in the original state nothing was selected:

      selectedValues.addAll((Collection)getConvertedInput());

      getConvertedInput() is null, so ArrayList.addAll() operates on the null value and throws the NPE.

      1. WICKET-1270.patch
        0.6 kB
        Thomas Jaeckle

        Activity

        Hide
        Thomas Jaeckle added a comment -

        Simple patch which first checks if getConvertedInput() is null.

        Show
        Thomas Jaeckle added a comment - Simple patch which first checks if getConvertedInput() is null.

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Jaeckle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development