[#121] container: Catch non-existent container owner case

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-09-20 16:57:18 +03:00 committed by Alex Vanin
parent cb385c920f
commit ea89844033

View file

@ -606,6 +606,10 @@ func getContainer(ctx storage.Context, cid []byte) Container {
func getOwnerByID(ctx storage.Context, cid []byte) []byte { func getOwnerByID(ctx storage.Context, cid []byte) []byte {
container := getContainer(ctx, cid) container := getContainer(ctx, cid)
if len(container.value) == 0 {
return nil
}
return ownerFromBinaryContainer(container.value) return ownerFromBinaryContainer(container.value)
} }