Skip to content

Commit 7dd09e7

Browse files
committed
Correctly handle nil return value
1 parent 9bb222b commit 7dd09e7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: commands/instances.go

+3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro
211211
return &arduino.InvalidArgumentError{Cause: err}
212212
}
213213
profile = sk.GetProfile(req.GetProfile())
214+
if profile == nil {
215+
return &arduino.UnknownProfileError{Profile: req.GetProfile()}
216+
}
214217
responseCallback(&rpc.InitResponse{
215218
Message: &rpc.InitResponse_Profile{
216219
Profile: &rpc.Profile{

0 commit comments

Comments
 (0)