Uploaded image for project: 'Click'
  1. Click
  2. CLK-220

Form file upload NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • None
    • core
    • None
    • Click 1.3

    Description

      The following bug was raised by David Rosenstark:
      ---------------------------------------------------------------------

      We have some code that was working fine in click 1.2
      We changed the jar to be 1.3 and are receiveing errors related to
      characterEncoding being null. The form we are submitting has a FileField.

      The code that is checking and throwing the exception from the Form class is
      here

      if (fileItem != null) {
      if (request.getCharacterEncoding() == null)

      { formName = fileItem.getString(); }

      try

      { formName = fileItem.getString(request.getCharacterEncoding()); }

      catch (UnsupportedEncodingException ex)

      { throw new RuntimeException(ex); }

      }

      Notice how you check to see if getCharacterEncoding() is null and then when
      it is null you still do: fileItem.getString(request.getCharacterEncoding());

      This line then throws the exception.

      Attachments

        Activity

          People

            medgar Malcolm Edgar
            medgar Malcolm Edgar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: