From fdde40d312799f37a94d80a37f740b2f2ac8f643 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Fri, 1 Aug 2014 12:19:48 +0300 Subject: [PATCH] fix for nil pointer in UpdateQueues --- engine/stats.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/stats.go b/engine/stats.go index e1d347580..ce630e338 100644 --- a/engine/stats.go +++ b/engine/stats.go @@ -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