From 14586afcf54951dd6a3085fad3f6cd2c5dae9dd8 Mon Sep 17 00:00:00 2001 From: Federico Fissore Date: Fri, 3 Jul 2015 18:09:56 +0200 Subject: [PATCH] Fixed possible NPE --- .../arduino/contributions/packages/ContributionsIndex.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java index c72d638ec..226ab424c 100644 --- a/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java +++ b/arduino-core/src/cc/arduino/contributions/packages/ContributionsIndex.java @@ -88,7 +88,11 @@ public abstract class ContributionsIndex { } public ContributedPlatform getInstalledPlatform(String packageName, String platformArch) { - List installedPlatforms = new LinkedList<>(Collections2.filter(findPlatforms(packageName, platformArch), new InstalledPredicate())); + List platforms = findPlatforms(packageName, platformArch); + if (platforms == null) { + return null; + } + List installedPlatforms = new LinkedList<>(Collections2.filter(platforms, new InstalledPredicate())); Collections.sort(installedPlatforms, new DownloadableContributionBuiltInAtTheBottomComparator()); if (installedPlatforms.isEmpty()) {