[#1141] metabase: Fix `IsUserObject` method

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
bugfix/make_group__name_required
Airat Arifullin 2024-05-20 13:19:51 +03:00
parent 89a80e9a0f
commit 40b04c00ef
1 changed files with 8 additions and 4 deletions

View File

@ -527,10 +527,14 @@ func containerObjectCounterInitialized(tx *bbolt.Tx) bool {
}
func IsUserObject(obj *objectSDK.Object) bool {
_, hasParentID := obj.ParentID()
return obj.Type() == objectSDK.TypeRegular &&
(obj.SplitID() == nil ||
(hasParentID && len(obj.Children()) == 0))
ech := obj.ECHeader()
if ech == nil {
_, hasParentID := obj.ParentID()
return obj.Type() == objectSDK.TypeRegular &&
(obj.SplitID() == nil ||
(hasParentID && len(obj.Children()) == 0))
}
return ech.Index() == 0 && (ech.ParentSplitID() == nil || ech.ParentSplitParentID() != nil)
}
// ZeroSizeContainers returns containers with size = 0.