Skip to content

Commit

Permalink
Merge pull request #67 from smartcontractkit/fix/nil-transport-write
Browse files Browse the repository at this point in the history
adding nil check before tr.Write call
  • Loading branch information
patrickhuie19 authored Dec 5, 2024
2 parents 2759ce2 + 19400fb commit e8034e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ func (cc *ClientConn) Invoke(ctx context.Context, method string, args interface{
cc.addrConn.mu.RUnlock()
cc.mu.RUnlock()

if tr == nil {
// addrConn is reconnecting
return errors.New("transport is unavailable for writing")
}

if err := tr.Write(ctx, reqB); err != nil {
return err
}
Expand Down

0 comments on commit e8034e3

Please sign in to comment.