From f85f0c096b07886a3bd1a786a99082717b671d94 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Mon, 4 Apr 2022 17:08:53 +0300 Subject: [PATCH] Resolve issue where a panic would occur when cost is nil --- engine/route_cost_sort.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/route_cost_sort.go b/engine/route_cost_sort.go index 646e3acd1..3cc5fb763 100644 --- a/engine/route_cost_sort.go +++ b/engine/route_cost_sort.go @@ -70,9 +70,9 @@ func populateCostForRoutes(ctx *context.Context, cfg *config.CGRConfig, } if acntCost.Concretes != nil { cost = acntCost.Concretes - } - if costFloat64, _ := cost.Float64(); extraOpts.maxCost != 0 && costFloat64 > extraOpts.maxCost { - continue + if costFloat64, _ := cost.Float64(); extraOpts.maxCost != 0 && costFloat64 > extraOpts.maxCost { + continue + } } acntIDs := make([]string, 0, len(acntCost.Accounts)) for acntID := range acntCost.Accounts {