From 63bcc21a465f9aa909c5eae5bb1c59c397de3d69 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Tue, 12 May 2015 07:45:54 +0300 Subject: [PATCH] protection against nil ratinginfo --- engine/balances.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/balances.go b/engine/balances.go index a06593757..6b5dd5b42 100644 --- a/engine/balances.go +++ b/engine/balances.go @@ -420,6 +420,10 @@ func (b *Balance) DebitMoney(cd *CallDescriptor, ub *Account, count bool, dryRun ts.createIncrementsSlice() } //log.Printf("TS: %+v", ts) + if ts.RateInterval == nil { + Logger.Err(fmt.Sprintf("Nil RateInterval ERROR on TS: %+v, CC: %+v, from CD: %+v", ts, cc, cd)) + continue + } maxCost, strategy := ts.RateInterval.GetMaxCost() //log.Printf("Timing: %+v", ts.RateInterval.Timing) //log.Printf("Rate: %+v", ts.RateInterval.Rating)