Skip to content

Commit e0feac8

Browse files
committed
Fix panic if a board has a property that starts with menu
1 parent 61185c6 commit e0feac8

File tree

2 files changed

+2
-1
lines changed
  • arduino/cores/packagemanager
  • test/testdata/platform_with_wrong_custom_board_options

2 files changed

+2
-1
lines changed

arduino/cores/packagemanager/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ func (pm *PackageManager) loadBoards(platform *cores.PlatformRelease) error {
388388
for boardID, boardProperties := range propertiesByBoard {
389389
var board *cores.Board
390390
for key := range boardProperties.AsMap() {
391-
if !strings.HasPrefix(key, "menu") {
391+
if !strings.HasPrefix(key, "menu.") {
392392
continue
393393
}
394394
// Menu keys are formed like this:

test/testdata/platform_with_wrong_custom_board_options/boards.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ altra.build.core=arduino
6060
altra.build.variant=standard
6161
altra.menu.cpu.atmega328=ATmega328P
6262
altra.menu.cpu.atmega168=ATmega168
63+
altra.menufoo=bar

0 commit comments

Comments
 (0)