更新目录为null是提示未找到...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2016-03-07 20:24:15 +08:00
parent 021feea554
commit 807dc562df

View File

@ -660,12 +660,21 @@ public class PluginsManager {
} else {
updateDirectory = directory;
}
if (updateDirectory == null) {
sender.sendMessage("§4异常: §c文件夹 §d服务器更新文件夹 §c未找到或IO错误!");
return false;
}
try {
sender.sendMessage("§6升级: §b从 §d" + updateDirectory.getCanonicalPath() + " §b文件夹检索插件插件!");
} catch (SecurityException | IOException e1) {
sender.sendMessage("§4异常: §c文件夹 §d" + updateDirectory.getName() + " §c权限不足或IO错误!");
return false;
}
final File[] plugins = updateDirectory.listFiles();
if (plugins.length == 0) {
sender.sendMessage("§6升级: §d更新文件夹未找到插件!");
return false;
}
for (final File file : updateDirectory.listFiles()) {
PluginDescriptionFile description = null;
try {