forked from TrueCloudLab/frostfs-s3-gw
[#704] Fix nil pointer dereference on decReader
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
5184ed66c6
commit
ffd259671a
1 changed files with 4 additions and 1 deletions
|
@ -449,7 +449,10 @@ func (n *layer) GetObject(ctx context.Context, p *GetObjectParams) error {
|
||||||
// copy full payload
|
// copy full payload
|
||||||
written, err := io.CopyBuffer(p.Writer, r, buf)
|
written, err := io.CopyBuffer(p.Writer, r, buf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("copy object payload written: '%d', decLength: '%d', params.ln: '%d' : %w", written, decReader.DecryptedLength(), params.ln, err)
|
if decReader != nil {
|
||||||
|
return fmt.Errorf("copy object payload written: '%d', decLength: '%d', params.ln: '%d' : %w", written, decReader.DecryptedLength(), params.ln, err)
|
||||||
|
}
|
||||||
|
return fmt.Errorf("copy object payload written: '%d': %w", written, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue