提交 f7faf4b8 编写于 作者: S sogabe

Fixed exception without uploaded Plugin.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32004 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a89abe26
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册