Author: psharples
Date: Tue Sep 6 15:41:33 2011
New Revision: 1165718
URL: http://svn.apache.org/viewvc?rev=1165718&view=rev
Log:
Added a little fix in the create() method, where each fileitem was assumed to
contain a name. In the case of submitting a web form for example, the "submit"
button becomes one of the items and does not always have a name attribute. So
we safety check to ensure its name is not null.
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetsController.java
Modified:
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetsController.java
URL:
http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetsController.java?rev=1165718&r1=1165717&r2=1165718&view=diff
==============================================================================
---
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetsController.java
(original)
+++
incubator/wookie/trunk/src/org/apache/wookie/controller/WidgetsController.java
Tue Sep 6 15:41:33 2011
@@ -202,7 +202,7 @@ public class WidgetsController extends C
// Only save .wgt files and ignore any others in the POST
//
for (FileItem item: items){
- if (item.getName().endsWith(".wgt")){
+ if (item.getName()!=null && item.getName().endsWith(".wgt")){
File saveFile = new File(DEPLOY_FOLDER + "/" + item.getName());
item.write(saveFile);
requestContainedWgtFile = true;