1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Fixed possible NPE

This commit is contained in:
Federico Fissore 2015-07-03 18:09:56 +02:00
parent 39c3f8bf61
commit 14586afcf5

View File

@ -88,7 +88,11 @@ public abstract class ContributionsIndex {
}
public ContributedPlatform getInstalledPlatform(String packageName, String platformArch) {
List<ContributedPlatform> installedPlatforms = new LinkedList<>(Collections2.filter(findPlatforms(packageName, platformArch), new InstalledPredicate()));
List<ContributedPlatform> platforms = findPlatforms(packageName, platformArch);
if (platforms == null) {
return null;
}
List<ContributedPlatform> installedPlatforms = new LinkedList<>(Collections2.filter(platforms, new InstalledPredicate()));
Collections.sort(installedPlatforms, new DownloadableContributionBuiltInAtTheBottomComparator());
if (installedPlatforms.isEmpty()) {