Skip to content

Commit 85aecfe

Browse files
committed
IDE: Fixed default board selection.
1 parent b9e186e commit 85aecfe

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ public TargetPlatform(String _name, File _folder, TargetPackage parent)
8585
boardsPreferences.remove("menu");
8686

8787
// Create boards
88-
Set<String> boardIDs = boardsPreferences.keySet();
89-
for (String id : boardIDs) {
90-
PreferencesMap preferences = boardsPreferences.get(id);
91-
TargetBoard board = new TargetBoard(id, preferences, this);
92-
boards.put(id, board);
93-
}
94-
if (!boardIDs.isEmpty()) {
95-
PreferencesMap preferences = boardsPreferences.get(boardIDs.iterator().next());
96-
defaultBoard = new TargetBoard(id, preferences, this);
88+
Set<String> boardIds = boardsPreferences.keySet();
89+
for (String boardId : boardIds) {
90+
PreferencesMap preferences = boardsPreferences.get(boardId);
91+
TargetBoard board = new TargetBoard(boardId, preferences, this);
92+
boards.put(boardId, board);
93+
94+
// Pick the first board as default
95+
if (defaultBoard == null)
96+
defaultBoard = board;
9797
}
9898
} catch (IOException e) {
9999
throw new TargetPlatformException(format(_("Error loading {0}"),

0 commit comments

Comments
 (0)