[#1254] policer: Fix svacer warning
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
27caa8a72f
commit
5e5ee545b6
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue