Skip to content

Commit d44acea

Browse files
committed
[executor] Prevent crash on nil RPC connection
1 parent 0755858 commit d44acea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

executor/executorcmd/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ type RpcClient struct {
127127
}
128128

129129
func (r *RpcClient) Close() error {
130-
return r.conn.Close()
130+
if r != nil && r.conn != nil {
131+
return r.conn.Close()
132+
}
133+
return nil
131134
}
132135

133136
func (r *RpcClient) FromDeviceState(state string) string {

0 commit comments

Comments
 (0)