[#115] rpcclient: Fix type getters
* Add type instance check for nil to avoid panic by accessing fields. Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
5e82e8c776
commit
2ae34b5458
1 changed files with 4 additions and 0 deletions
|
@ -20,5 +20,9 @@ type Conn interface {
|
||||||
// Client should not be used after Close() call
|
// Client should not be used after Close() call
|
||||||
// on the connection: behavior is undefined.
|
// on the connection: behavior is undefined.
|
||||||
func (c *Client) Conn() io.Closer {
|
func (c *Client) Conn() io.Closer {
|
||||||
|
if c == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return c.conn
|
return c.conn
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue