mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
ips: prevent panic when no pools match filters
This commit is contained in:
committed by
Dan Christian Bogos
parent
262f1dafa3
commit
82cfff3cff
@@ -338,6 +338,9 @@ func filterAndSortPools(ctx *context.Context, tenant string, pools []*utils.IPPo
|
||||
weights[pool.ID] = weight
|
||||
filteredPools = append(filteredPools, pool)
|
||||
}
|
||||
if len(filteredPools) == 0 {
|
||||
return nil, utils.ErrNotFound
|
||||
}
|
||||
|
||||
// Sort by weight (higher values first).
|
||||
slices.SortFunc(filteredPools, func(a, b *utils.IPPool) int {
|
||||
|
||||
Reference in New Issue
Block a user