fix NPEs loading invalid packages
This commit is contained in:
parent
f93f47ee24
commit
8b3ce7b3cc
|
@ -128,6 +128,9 @@ public abstract class BasePackageCacheManager implements IPackageCacheManager {
|
|||
}
|
||||
|
||||
private String getPackageId(String canonical, String server) throws IOException {
|
||||
if (canonical == null) {
|
||||
return null;
|
||||
}
|
||||
PackageClient pc = myClientFactory.apply(server);
|
||||
List<PackageClient.PackageInfo> res = pc.search(null, canonical, null, false);
|
||||
if (res.size() == 0) {
|
||||
|
|
|
@ -544,6 +544,9 @@ public class FilesystemPackageCacheManager extends BasePackageCacheManager imple
|
|||
// ========================= Package Mgmt API =======================================================================
|
||||
|
||||
private String getPackageIdFromBuildList(String canonical) throws IOException {
|
||||
if (canonical == null) {
|
||||
return null;
|
||||
}
|
||||
checkBuildLoaded();
|
||||
if (buildInfo != null) {
|
||||
for (JsonElement n : buildInfo) {
|
||||
|
|
Loading…
Reference in New Issue