protection against nil ratinginfo

This commit is contained in:
Radu Ioan Fericean
2015-05-12 07:45:54 +03:00
parent 5ec5fa2064
commit 63bcc21a46

View File

@@ -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)