Skip to content

Commit

Permalink
[executor] Prevent crash on nil RPC connection
Browse files Browse the repository at this point in the history
  • Loading branch information
teo committed Oct 6, 2023
1 parent 0755858 commit d44acea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion executor/executorcmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ type RpcClient struct {
}

func (r *RpcClient) Close() error {
return r.conn.Close()
if r != nil && r.conn != nil {
return r.conn.Close()
}
return nil
}

func (r *RpcClient) FromDeviceState(state string) string {
Expand Down

0 comments on commit d44acea

Please sign in to comment.