1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-13 10:29:35 +01:00

Fix NPE if referred core is nonexistent

Fixes #5502
This commit is contained in:
Martino Facchin 2016-10-27 09:52:40 +02:00
parent de9bd89a01
commit 12eb09f0b9

View File

@ -162,12 +162,14 @@ public class BaseNoGui {
// Add all tools dependencies from the (possibily) referenced core
String core = prefs.get("build.core");
if (core.contains(":")) {
if (core != null && core.contains(":")) {
String split[] = core.split(":");
TargetPlatform referenced = BaseNoGui.getCurrentTargetPlatformFromPackage(split[0]);
ContributedPlatform referencedPlatform = indexer.getContributedPlaform(referenced);
if (referencedPlatform != null)
requiredTools.addAll(referencedPlatform.getResolvedTools());
if (referenced != null) {
ContributedPlatform referencedPlatform = indexer.getContributedPlaform(referenced);
if (referencedPlatform != null)
requiredTools.addAll(referencedPlatform.getResolvedTools());
}
}
String prefix = "runtime.tools.";