Skip to content

Commit f3b7f0a

Browse files
committed
Check if variantFolder exists and is a folder
Fixes arduino#126
1 parent ce6c187 commit f3b7f0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: legacy/builder/phases/core_builder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ func compileCore(ctx *types.Context, buildPath *paths.Path, buildCachePath *path
7878

7979
includes := []string{}
8080
includes = append(includes, coreFolder.String())
81-
if variantFolder != nil {
81+
if variantFolder != nil && variantFolder.IsDir() {
8282
includes = append(includes, variantFolder.String())
8383
}
8484
includes = utils.Map(includes, utils.WrapWithHyphenI)
8585

8686
var err error
8787

8888
variantObjectFiles := paths.NewPathList()
89-
if variantFolder != nil {
89+
if variantFolder != nil && variantFolder.IsDir() {
9090
variantObjectFiles, err = builder_utils.CompileFiles(ctx, variantFolder, true, buildPath, buildProperties, includes)
9191
if err != nil {
9292
return nil, nil, i18n.WrapError(err)

0 commit comments

Comments
 (0)