1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-21 10:52:14 +01:00

Merge pull request #10922 from matthijskooijman/fix-no-board-null-pointer

rebuildProgrammerMenu: Handle no current board
This commit is contained in:
Martino Facchin 2020-12-01 10:06:59 +01:00 committed by GitHub
commit 76dfd0acc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1702,6 +1702,7 @@ public class Base {
ButtonGroup group = new ButtonGroup();
TargetBoard board = BaseNoGui.getTargetBoard();
if (board != null) {
TargetPlatform boardPlatform = board.getContainerPlatform();
TargetPlatform corePlatform = null;
@ -1714,6 +1715,7 @@ public class Base {
addProgrammersForPlatform(boardPlatform, programmerMenus, group);
if (corePlatform != null)
addProgrammersForPlatform(corePlatform, programmerMenus, group);
}
if (programmerMenus.isEmpty()) {
JMenuItem item = new JMenuItem(tr("No programmers available for this board"));