Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 76dfd0a

Browse files
Merge pull request #10922 from matthijskooijman/fix-no-board-null-pointer
rebuildProgrammerMenu: Handle no current board
2 parents a056a5f + 61e12d5 commit 76dfd0a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

‎app/src/processing/app/Base.java‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,18 +1702,20 @@ public void rebuildProgrammerMenu() {
17021702
ButtonGroup group = new ButtonGroup();
17031703

17041704
TargetBoard board = BaseNoGui.getTargetBoard();
1705-
TargetPlatform boardPlatform = board.getContainerPlatform();
1706-
TargetPlatform corePlatform = null;
1705+
if (board != null) {
1706+
TargetPlatform boardPlatform = board.getContainerPlatform();
1707+
TargetPlatform corePlatform = null;
17071708

1708-
String core = board.getPreferences().get("build.core");
1709-
if (core != null && core.contains(":")) {
1710-
String[] split = core.split(":", 2);
1711-
corePlatform = BaseNoGui.getCurrentTargetPlatformFromPackage(split[0]);
1712-
}
1709+
String core = board.getPreferences().get("build.core");
1710+
if (core != null && core.contains(":")) {
1711+
String[] split = core.split(":", 2);
1712+
corePlatform = BaseNoGui.getCurrentTargetPlatformFromPackage(split[0]);
1713+
}
17131714

1714-
addProgrammersForPlatform(boardPlatform, programmerMenus, group);
1715-
if (corePlatform != null)
1716-
addProgrammersForPlatform(corePlatform, programmerMenus, group);
1715+
addProgrammersForPlatform(boardPlatform, programmerMenus, group);
1716+
if (corePlatform != null)
1717+
addProgrammersForPlatform(corePlatform, programmerMenus, group);
1718+
}
17171719

17181720
if (programmerMenus.isEmpty()) {
17191721
JMenuItem item = new JMenuItem(tr("No programmers available for this board"));

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /