Skip to content

Commit

Permalink
Merge pull request #68 from smartcontractkit/bug/addrConn-nil-invoke
Browse files Browse the repository at this point in the history
checking addrConn is nil before proceeding with Invoke
  • Loading branch information
patrickhuie19 authored Dec 12, 2024
2 parents e8034e3 + aa19cae commit 6f457b0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ func (cc *ClientConn) Close() error {
func (cc *ClientConn) Invoke(ctx context.Context, method string, args interface{}, reply interface{}) error {
// Ensure the connection state is ready
cc.mu.RLock()
if cc.addrConn == nil {
return errors.New("client connection is not ready to proceed with Invoke")
}
cc.addrConn.mu.RLock()
state := cc.addrConn.state
cc.addrConn.mu.RUnlock()
Expand Down

0 comments on commit 6f457b0

Please sign in to comment.