mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Fixed possible NPE
This commit is contained in:
parent
39c3f8bf61
commit
14586afcf5
@ -88,7 +88,11 @@ public abstract class ContributionsIndex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ContributedPlatform getInstalledPlatform(String packageName, String platformArch) {
|
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());
|
Collections.sort(installedPlatforms, new DownloadableContributionBuiltInAtTheBottomComparator());
|
||||||
|
|
||||||
if (installedPlatforms.isEmpty()) {
|
if (installedPlatforms.isEmpty()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user