From ce92df35438ad95f709599eff3d203d29da217f0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 1 Dec 2020 16:33:59 +0300 Subject: [PATCH] [#222] Return nil in `metabase.IsSmall` if object is big Signed-off-by: Alex Vanin --- pkg/local_object_storage/metabase/v2/small.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/local_object_storage/metabase/v2/small.go b/pkg/local_object_storage/metabase/v2/small.go index b07158199..6b34edc0d 100644 --- a/pkg/local_object_storage/metabase/v2/small.go +++ b/pkg/local_object_storage/metabase/v2/small.go @@ -27,7 +27,9 @@ func (db *DB) isSmall(tx *bbolt.Tx, addr *objectSDK.Address) (*blobovnicza.ID, e } blobovniczaID := smallBucket.Get(objectKey(addr.ObjectID())) - id := blobovnicza.NewIDFromBytes(blobovniczaID) + if len(blobovniczaID) == 0 { + return nil, nil + } - return id, nil + return blobovnicza.NewIDFromBytes(blobovniczaID), nil }