Skip to content

Commit 72c141c

Browse files
committed
Signed-off-by: Cristian Maglie <c.maglie@arduino.cc>
2 parents e6f25db + cdf46f5 commit 72c141c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/arduino.cc/builder/constants/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ const MSG_BOARD_UNKNOWN = "Board {0} (platform {1}, package {2}) is unknown"
149149
const MSG_BOOTLOADER_FILE_MISSING = "Bootloader file specified but missing: {0}"
150150
const MSG_BUILD_OPTIONS_CHANGED = "Build options changed, rebuilding all"
151151
const MSG_CANT_FIND_SKETCH_IN_PATH = "Unable to find {0} in {1}"
152+
const MSG_FQBN_INVALID = "{0} is not a valid fully qualified board name. Required format is targetPackageName:targetPlatformName:targetBoardName."
152153
const MSG_INVALID_QUOTING = "Invalid quoting: no closing [{0}] char found."
153154
const MSG_LIB_LEGACY = "(legacy)"
154155
const MSG_LIBRARIES_MULTIPLE_LIBS_FOUND_FOR = "Multiple libraries were found for \"{0}\""

src/arduino.cc/builder/target_board_resolver.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error {
4343
fqbn := ctx.FQBN
4444

4545
fqbnParts := strings.Split(fqbn, ":")
46+
if len(fqbnParts) < 3 {
47+
return utils.Errorf(context, constants.MSG_FQBN_INVALID, fqbn)
48+
}
4649
targetPackageName := fqbnParts[0]
4750
targetPlatformName := fqbnParts[1]
4851
targetBoardName := fqbnParts[2]

0 commit comments

Comments
 (0)