From 514df9a489c370fe4180e978a7fb9426bf87afe4 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 5 Aug 2014 23:24:20 +0200 Subject: [PATCH] Fix nil pointer on timespans which are not paid --- engine/callcost.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/callcost.go b/engine/callcost.go index 0b8b21bee..1db9e1ed7 100644 --- a/engine/callcost.go +++ b/engine/callcost.go @@ -150,7 +150,7 @@ func (cc *CallCost) ToDataCost() (*DataCost, error) { func (cc *CallCost) GetLongestRounding() (roundingDecimals int, roundingMethod string) { for _, ts := range cc.Timespans { - if ts.RateInterval.Rating.RoundingDecimals > roundingDecimals { + if ts.RateInterval != nil && ts.RateInterval.Rating.RoundingDecimals > roundingDecimals { //ToDo: When will ts.RateInterval be empty? roundingDecimals = ts.RateInterval.Rating.RoundingDecimals roundingMethod = ts.RateInterval.Rating.RoundingMethod }