Skip to content

Commit

Permalink
fix pointer dereference partially
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcary committed Apr 25, 2024
1 parent 0b9c4d7 commit a41fdd7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rpc/getAccountInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (cl *Client) GetAccountInfoWithOpts(
if err != nil {
return nil, err
}
if out.Value == nil {
if out == nil || out.Value == nil {
return nil, ErrNotFound
}
return out, nil
Expand Down
6 changes: 5 additions & 1 deletion rpc/getAccountInfoWithRpcContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ func (cl *Client) GetAccountInfoWithRpcContext(
if err != nil {
return nil, nil, err
}
return out.Value, &out.RPCContext, nil
if out == nil {
return nil, nil, nil
} else {
return out.Value, &out.RPCContext, nil
}
}
2 changes: 1 addition & 1 deletion rpc/getMultipleAccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (cl *Client) GetMultipleAccountsWithOpts(
if err != nil {
return nil, err
}
if out.Value == nil {
if out == nil || out.Value == nil {
return nil, ErrNotFound
}
return
Expand Down
2 changes: 1 addition & 1 deletion rpc/getSignatureStatuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (cl *Client) GetSignatureStatuses(
if err != nil {
return nil, err
}
if out.Value == nil {
if out == nil || out.Value == nil {
// Unknown transaction
return nil, ErrNotFound
}
Expand Down

0 comments on commit a41fdd7

Please sign in to comment.