Skip to content

Commit 1f9ebb0

Browse files
committed
Correctly handle nil return value
1 parent da9c096 commit 1f9ebb0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

commands/instances.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro
218218
return &arduino.InvalidArgumentError{Cause: err}
219219
}
220220
profile = sk.GetProfile(req.GetProfile())
221+
if profile == nil {
222+
return &arduino.UnknownProfileError{Profile: req.GetProfile()}
223+
}
221224
responseCallback(&rpc.InitResponse{
222225
Message: &rpc.InitResponse_Profile{
223226
Profile: &rpc.Profile{

0 commit comments

Comments
 (0)