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

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
enable-notary-in-public-chains
Alex Vanin 2021-09-20 16:57:18 +03:00 committed by Alex Vanin
parent cb385c920f
commit ea89844033
1 changed files with 4 additions and 0 deletions

View File

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