Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
6bab4d0b
Commit
6bab4d0b
authored
Jan 15, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added check for nil-pointer panic
parent
37168166
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
commands/commands_test.go
commands/commands_test.go
+6
-1
commands/compile/compile.go
commands/compile/compile.go
+2
-2
No files found.
commands/commands_test.go
View file @
6bab4d0b
...
...
@@ -493,8 +493,13 @@ func TestCompileCommands(t *testing.T) {
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch created"
)
// Build sketch
for arduino:avr:uno
// Build sketch
without FQBN
test1
:=
currSketchbookDir
.
Join
(
"Test1"
)
.
String
()
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
test1
)
require
.
NotZero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"No Fully Qualified Board Name provided"
)
// Build sketch for arduino:avr:uno
exitCode
,
d
=
executeWithArgs
(
t
,
"compile"
,
"-b"
,
"arduino:avr:uno"
,
test1
)
require
.
Zero
(
t
,
exitCode
,
"exit code"
)
require
.
Contains
(
t
,
string
(
d
),
"Sketch uses"
)
...
...
commands/compile/compile.go
View file @
6bab4d0b
...
...
@@ -31,7 +31,7 @@ import (
"github.com/arduino/arduino-cli/commands"
"github.com/arduino/arduino-cli/commands/core"
"github.com/arduino/arduino-cli/common/formatter"
"github.com/arduino/go-paths-helper"
paths
"github.com/arduino/go-paths-helper"
properties
"github.com/arduino/go-properties-orderedmap"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
...
...
@@ -109,7 +109,7 @@ func run(cmd *cobra.Command, args []string) {
os
.
Exit
(
commands
.
ErrGeneric
)
}
if
flags
.
fqbn
==
""
&&
sketch
!=
nil
{
if
flags
.
fqbn
==
""
&&
sketch
!=
nil
&&
sketch
.
Metadata
!=
nil
{
flags
.
fqbn
=
sketch
.
Metadata
.
CPU
.
Fqbn
}
if
flags
.
fqbn
==
""
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment