Skip to content

Commit e76d413

Browse files
author
Federico Fissore
committed
When build.core is not defined, fall back to "arduino". Fixes #2635
1 parent ff6fb31 commit e76d413

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

arduino-core/src/processing/app/BaseNoGui.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static public void onBoardOrPortChange() {
688688
// Add library folder for the current selected platform
689689
TargetPlatform targetPlatform = getTargetPlatform();
690690
if (targetPlatform != null) {
691-
String core = getBoardPreferences().get("build.core");
691+
String core = getBoardPreferences().get("build.core", "arduino");
692692
if (core.contains(":")) {
693693
String referencedCore = core.split(":")[0];
694694
TargetPlatform referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.getId());

arduino-core/src/processing/app/debug/Compiler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ private PreferencesMap createBuildPreferences(String _buildPath,
426426
TargetPlatform targetPlatform = BaseNoGui.getTargetPlatform();
427427
TargetPlatform corePlatform = null;
428428
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
429-
String core = boardPreferences.get("build.core");
429+
String core = boardPreferences.get("build.core", "arduino");
430430
if (core.contains(":")) {
431431
String[] split = core.split(":");
432432
core = split[1];

arduino-core/src/processing/app/helpers/PreferencesMap.java

+8
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,12 @@ public boolean putBoolean(String key, boolean value) {
319319
return new Boolean(prev);
320320
}
321321

322+
public String get(String key, String defaultValue) {
323+
String value = get(key);
324+
if (value != null) {
325+
return value;
326+
}
327+
return defaultValue;
328+
}
329+
322330
}

0 commit comments

Comments
 (0)