[jboss-user] [JBoss Seam] - MultipartRequest NPE if no file is selected in s:uploadFile

dilator do-not-reply at jboss.com
Wed Feb 21 11:19:35 EST 2007


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)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020044#4020044

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020044



More information about the jboss-user mailing list