2 Replies Latest reply on Feb 21, 2007 11:56 AM by Ben Catherall

    MultipartRequest NPE if no file is selected in s:uploadFile

    Ben Catherall Newbie

      If no file is selected in a form with an s:uploadFile component, I get an NPE - new FileInputStream(null). Fix in the comment :)

      public InputStream getInputStream()
       {
       if (bOut != null)
       {
       return new ByteArrayInputStream(bOut.toByteArray());
       }
       else // <---- fix: if (tempFile != null)
       {
       try
       {
       return new FileInputStream(tempFile);
       }
       catch (FileNotFoundException ex) { }
       }
      
       return null;
       }


      Also, I cant build seam-ui from CVS at the moment, can someone commit their org.jboss.seam.ui.resource.WebResource :P (dependent class is SelectDate)