fix for smggenreic nil pointer

This commit is contained in:
Radu Ioan Fericean
2016-01-20 16:04:14 +02:00
parent 4d6be144c3
commit 12c09575e3

View File

@@ -237,9 +237,14 @@ func (self *SMGeneric) ChargeEvent(gev SMGenericEvent, clnt *rpc2.Client) (maxDu
}
var withErrors bool
for _, sR := range sessionRuns {
var cc *engine.CallCost
for _, ccSR := range sR.CallCosts {
cc.Merge(ccSR)
if len(sR.CallCosts) == 0 {
continue
}
cc := sR.CallCosts[0]
if len(sR.CallCosts) > 1 {
for _, ccSR := range sR.CallCosts[1:] {
cc.Merge(ccSR)
}
}
var reply string
if err := self.cdrsrv.LogCallCost(&engine.CallCostLog{