diff --git a/arduino-core/src/processing/app/BaseNoGui.java b/arduino-core/src/processing/app/BaseNoGui.java index 437c6322e..d9cf887f9 100644 --- a/arduino-core/src/processing/app/BaseNoGui.java +++ b/arduino-core/src/processing/app/BaseNoGui.java @@ -688,7 +688,7 @@ public class BaseNoGui { // Add library folder for the current selected platform TargetPlatform targetPlatform = getTargetPlatform(); if (targetPlatform != null) { - String core = getBoardPreferences().get("build.core"); + String core = getBoardPreferences().get("build.core", "arduino"); if (core.contains(":")) { String referencedCore = core.split(":")[0]; TargetPlatform referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.getId()); diff --git a/arduino-core/src/processing/app/debug/Compiler.java b/arduino-core/src/processing/app/debug/Compiler.java index 48e5250b8..a23836a0e 100644 --- a/arduino-core/src/processing/app/debug/Compiler.java +++ b/arduino-core/src/processing/app/debug/Compiler.java @@ -426,7 +426,7 @@ public class Compiler implements MessageConsumer { TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform(); TargetPlatform corePlatform = null; PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences(); - String core = boardPreferences.get("build.core"); + String core = boardPreferences.get("build.core", "arduino"); if (core.contains(":")) { String[] split = core.split(":"); core = split[1]; diff --git a/arduino-core/src/processing/app/helpers/PreferencesMap.java b/arduino-core/src/processing/app/helpers/PreferencesMap.java index b40b8c97a..4d16e3e38 100644 --- a/arduino-core/src/processing/app/helpers/PreferencesMap.java +++ b/arduino-core/src/processing/app/helpers/PreferencesMap.java @@ -319,4 +319,12 @@ public class PreferencesMap extends LinkedHashMap { return new Boolean(prev); } + public String get(String key, String defaultValue) { + String value = get(key); + if (value != null) { + return value; + } + return defaultValue; + } + }