[#543] object/get: Fix potential NPE on request forwarder
Request forwarding callback should be called only if set since it is an optional parameter. In GetRangeHash forwarder is never set. Call `forwarder` function only if it is non-nil. Remove no longer needed `hashOnly` option. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
89b147ebe7
commit
b2002ffc6d
3 changed files with 3 additions and 13 deletions
|
@ -80,7 +80,7 @@ func (c *clientCacheWrapper) get(addr string) (getClient, error) {
|
|||
}
|
||||
|
||||
func (c *clientWrapper) getObject(exec *execCtx) (*objectSDK.Object, error) {
|
||||
if !exec.assembling && !exec.hashOnly() {
|
||||
if !exec.assembling && exec.prm.forwarder != nil {
|
||||
return exec.prm.forwarder(c.client)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue