Fixed exception without uploaded Plugin.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32004 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
sogabe committed 2010-06-13 12:35:50 +00:00
1 parent a89abe260b
commit f7faf4b8e8
1 file changed
+2
@@ -548,6 +548,8 @@ public abstract class PluginManager extends AbstractModelObject {
// Parse the request
FileItem fileItem = (FileItem) upload.parseRequest(req).get(0);
String fileName = Util.getFileName(fileItem.getName());
if("".equals(fileName))
return new HttpRedirect("advanced");
if(!fileName.endsWith(".hpi"))
throw new Failure(hudson.model.Messages.Hudson_NotAPlugin(fileName));
fileItem.write(new File(rootDir, fileName));