Revision: 848
          http://stripes.svn.sourceforge.net/stripes/?rev=848&view=rev
Author:   bengunter
Date:     2008-02-08 06:37:29 -0800 (Fri, 08 Feb 2008)

Log Message:
-----------
Fixed STS-508. Was calling FileItem.getName() without checking for null 
reference first.

Modified Paths:
--------------
    
trunk/stripes/src/net/sourceforge/stripes/controller/multipart/CommonsMultipartWrapper.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/multipart/CommonsMultipartWrapper.java
===================================================================
--- 
trunk/stripes/src/net/sourceforge/stripes/controller/multipart/CommonsMultipartWrapper.java
 2008-02-08 03:20:20 UTC (rev 847)
+++ 
trunk/stripes/src/net/sourceforge/stripes/controller/multipart/CommonsMultipartWrapper.java
 2008-02-08 14:37:29 UTC (rev 848)
@@ -155,12 +155,13 @@
      */
     public FileBean getFileParameterValue(String name) {
         final FileItem item = this.files.get(name);
-        String filename = item.getName();
-        if (item == null || ((filename == null || filename.length() == 0) && 
item.getSize() == 0)) {
+        if (item == null
+                || ((item.getName() == null || item.getName().length() == 0) 
&& item.getSize() == 0)) {
             return null;
         }
         else {
             // Attempt to ensure the file name is just the basename with no 
path included
+            String filename = item.getName();
             int index;
             if (WINDOWS_PATH_PREFIX_PATTERN.matcher(filename).find())
                 index = filename.lastIndexOf('\\');


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to