From cc6209e8a011974ef25a5be53ccac8c59ff0414e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 30 May 2022 09:41:26 +0300 Subject: [PATCH] [#1449] object/delete: Fix NPE in `collectChain` `head.previous` method returns (nil, nil) if object has no previous neighbor. Signed-off-by: Leonard Lyubich --- pkg/services/object/delete/exec.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/services/object/delete/exec.go b/pkg/services/object/delete/exec.go index cfefd8ada..ab012ab3e 100644 --- a/pkg/services/object/delete/exec.go +++ b/pkg/services/object/delete/exec.go @@ -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 + } } }