Skip to content

Commit

Permalink
Merge pull request #52 from kaleido-io/nil-err-res
Browse files Browse the repository at this point in the history
Additional nil check on CallRPC
  • Loading branch information
peterbroadhurst authored Nov 10, 2023
2 parents e4d4a70 + cd9dc11 commit 356a095
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rpcbackend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (rc *RPCClient) CallRPC(ctx context.Context, result interface{}, method str
}
res, err := rc.SyncRequest(ctx, rpcReq)
if err != nil {
if res.Error != nil && res.Error.Code != 0 {
if res != nil && res.Error != nil && res.Error.Code != 0 {
return res.Error
}
return &RPCError{Code: int64(RPCCodeInternalError), Message: err.Error()}
Expand Down

0 comments on commit 356a095

Please sign in to comment.