[#1449] object/delete: Fix NPE in `collectChain`

`head.previous` method returns (nil, nil) if object has no previous
neighbor.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/fyrchik/cli-common
Leonard Lyubich 2022-05-30 09:41:26 +03:00 committed by LeL
parent 96cdc04705
commit cc6209e8a0
1 changed files with 4 additions and 2 deletions

View File

@ -153,8 +153,10 @@ func (exec *execCtx) collectChain() bool {
exec.status = statusOK
exec.err = nil
withPrev = true
prev = *p
withPrev = p != nil
if withPrev {
prev = *p
}
}
}