Skip to content

Commit ca27f48

Browse files
committed
commands:sketch:sync Prevent panic if netrc is not configured
Signed-off-by: Matteo Suppo <matteo.suppo@gmail.com>
1 parent 29454e4 commit ca27f48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commands/sketch/sync.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ func login() (string, string, error) {
448448

449449
logrus.Info("Searching for user credentials into the ~/.netrc file")
450450
arduinoMachine := NetRC.FindMachine("arduino.cc")
451-
if arduinoMachine.Name != "arduino.cc" {
451+
if arduinoMachine == nil || arduinoMachine.Name != "arduino.cc" {
452452
logrus.WithError(err).Error("Credentials not found")
453453
return "", "", errors.New("Credentials not found, try typing `arduino login` to login")
454454
}

0 commit comments

Comments
 (0)