Skip to content

Commit 6883b39

Browse files
authored
[skip-changelog] Fixed nil pointer exception (#1733)
1 parent afdc20c commit 6883b39

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: commands/instances.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ func Init(req *rpc.InitRequest, responseCallback func(r *rpc.InitResponse)) erro
176176
if responseCallback == nil {
177177
responseCallback = func(r *rpc.InitResponse) {}
178178
}
179-
instance := instances[req.Instance.Id]
179+
reqInst := req.GetInstance()
180+
if reqInst == nil {
181+
return &arduino.InvalidInstanceError{}
182+
}
183+
instance := instances[reqInst.GetId()]
180184
if instance == nil {
181185
return &arduino.InvalidInstanceError{}
182186
}

0 commit comments

Comments
 (0)