Bug fix(Issue#1141): Check if peer is nil before trying to derefer it. (#1143)

This commit is contained in:
MakMukhi
2017-04-04 15:08:14 -07:00
committed by GitHub
parent ee8ed34bcf
commit f45e6e3b30
2 changed files with 26 additions and 1 deletions

View File

@ -189,7 +189,9 @@ func Trailer(md *metadata.MD) CallOption {
// unary RPC.
func Peer(peer *peer.Peer) CallOption {
return afterCall(func(c *callInfo) {
*peer = *c.peer
if c.peer != nil {
*peer = *c.peer
}
})
}