修复一个更新源数据时发现的迭代错误...

This commit is contained in:
j502647092 2015-11-08 00:55:09 +08:00
parent d755b700d1
commit 1d29be976d
2 changed files with 4 additions and 5 deletions

View File

@ -55,7 +55,7 @@
</build>
<properties>
<jenkins.url>http://ci.citycraft.cn:8080</jenkins.url>
<update.description>修复更新仓库时产生的NPE错误...</update.description>
<update.description>修复一个更新源数据时发现的迭代错误...</update.description>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>

View File

@ -220,7 +220,8 @@ public class RepositoryManager {
if (updateRepositories(sender, string)) {
sender.sendMessage("§6源: §e" + string + " §a更新成功!");
} else {
sender.sendMessage("§6源: §e" + string + " §c更新失败!");
sender.sendMessage("§6源: §e" + string + " §c未找到任何仓库信息 已删除!");
keys.remove();
}
}
return true;
@ -232,13 +233,11 @@ public class RepositoryManager {
}
final String json = getHtml(urlstring);
if (json == null || json.isEmpty()) {
sender.sendMessage("§6源: §e" + urlstring + " §c未找到任何仓库信息 已删除!");
repos.remove(urlstring);
return false;
}
final List<Repository> lrepo = jsonToRepositories(json);
if (lrepo == null || lrepo.isEmpty()) {
return false;
return true;
}
for (final Repository repository : lrepo) {
addPackage(sender, repository.url);