fix for nil pointer in UpdateQueues

This commit is contained in:
Radu Ioan Fericean
2014-08-01 12:19:48 +03:00
parent eef3a43016
commit fdde40d312

View File

@@ -83,9 +83,12 @@ func (s *Stats) UpdateQueues(css []*CdrStats, out *int) error {
for _, cs := range css {
var sq *StatsQueue
var existing bool
if sq, existing = oldQueues[cs.Id]; existing {
sq.conf = cs
} else {
if oldQueues != nil {
if sq, existing = oldQueues[cs.Id]; existing {
sq.conf = cs
}
}
if sq == nil {
sq = NewStatsQueue(cs)
}
s.queues[cs.Id] = sq