diff --git a/pkg/services/policer/ec.go b/pkg/services/policer/ec.go index 5b3793f7..0a118797 100644 --- a/pkg/services/policer/ec.go +++ b/pkg/services/policer/ec.go @@ -25,7 +25,7 @@ type ecChunkProcessResult struct { removeLocal bool } -var errInvalidECPlacement = errors.New("invalid EC placement: EC placement must have one placement vector") +var errInvalidECPlacement = errors.New("invalid EC placement: EC placement must have one placement vector with at least one node") func (p *Policer) processECContainerObject(ctx context.Context, objInfo objectcore.Info, policy netmap.PlacementPolicy) error { if objInfo.ECInfo == nil { @@ -42,7 +42,7 @@ func (p *Policer) processECContainerRepObject(ctx context.Context, objInfo objec if err != nil { return fmt.Errorf("%s: %w", logs.PolicerCouldNotBuildPlacementVectorForObject, err) } - if len(nn) != 1 { + if len(nn) != 1 || len(nn[0]) == 0 { return errInvalidECPlacement } @@ -72,7 +72,7 @@ func (p *Policer) processECContainerECObject(ctx context.Context, objInfo object if err != nil { return fmt.Errorf("%s: %w", logs.PolicerCouldNotBuildPlacementVectorForObject, err) } - if len(nn) != 1 { + if len(nn) != 1 || len(nn[0]) == 0 { return errInvalidECPlacement }