[#222] Return nil in metabase.IsSmall if object is big

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-01 16:33:59 +03:00
parent 862f9a3f1a
commit ce92df3543

View file

@ -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
}