Skip to content

Commit

Permalink
Added a nil check for resp.GetError() in the EOS gRPC client. This fi…
Browse files Browse the repository at this point in the history
…xes a nil pointer dereference in the RollbackToVersion method
  • Loading branch information
Jesse Geens committed Oct 21, 2024
1 parent d2b2c10 commit 55dc358
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1544,8 +1544,9 @@ func (c *Client) RollbackToVersion(ctx context.Context, auth eosclient.Authoriza
return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' ", auth.Role.UID))
}

log.Info().Str("func", "RollbackToVersion").Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response")

if resp.GetError() != nil {
log.Info().Str("func", "RollbackToVersion").Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response")
}
return err
}

Expand Down

0 comments on commit 55dc358

Please sign in to comment.