From 3fcf8716e0a149f847dfda3822c1ccffc86c2115 Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Fri, 1 Aug 2014 21:13:41 +0300 Subject: [PATCH] check for len ==0 instead of nil --- engine/stats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/stats.go b/engine/stats.go index 68ddd4e42..bc4f4ed1d 100644 --- a/engine/stats.go +++ b/engine/stats.go @@ -88,7 +88,7 @@ func (s *Stats) AddQueue(cs *CdrStats, out *int) error { } func (s *Stats) ReloadQueues(ids []string, out *int) error { - if ids == nil { + if len(ids) == 0 { if css, err := s.ratingDb.GetAllCdrStats(); err == nil { s.UpdateQueues(css, nil) } else { @@ -106,7 +106,7 @@ func (s *Stats) ReloadQueues(ids []string, out *int) error { } func (s *Stats) ResetQueues(ids []string, out *int) error { - if ids == nil { + if len(ids) == 0 { for _, sq := range s.queues { sq.cdrs = make([]*QCdr, 0) sq.metrics = make(map[string]Metric, len(sq.conf.Metrics))