Skip to content

Commit

Permalink
Additional nil check on CallRPC
Browse files Browse the repository at this point in the history
Signed-off-by: Nicko Guyer <[email protected]>
  • Loading branch information
nguyer committed Nov 10, 2023
1 parent e4d4a70 commit cd9dc11
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 cd9dc11

Please sign in to comment.