From c561db9c82f2ed54e5ae731db6837bfec24530bf Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Fri, 18 Dec 2015 18:53:32 +0200 Subject: [PATCH] more mongo nil checking --- engine/storage_mongo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/storage_mongo.go b/engine/storage_mongo.go index 2febd4cc1..bd930f3f2 100644 --- a/engine/storage_mongo.go +++ b/engine/storage_mongo.go @@ -1044,7 +1044,7 @@ func (ms *MongoStorage) GetActionPlan(key string, skipCache bool) (ats *ActionPl ats = kv.Value cache2go.Cache(utils.ACTION_PLAN_PREFIX+key, ats) } - if ats.AccountIDs != nil { + if ats != nil && ats.AccountIDs != nil { ats.AccountIDs = utils.YesDots(ats.AccountIDs) } return @@ -1052,7 +1052,7 @@ func (ms *MongoStorage) GetActionPlan(key string, skipCache bool) (ats *ActionPl func (ms *MongoStorage) SetActionPlan(key string, ats *ActionPlan) error { // clean dots from account ids map - if ats.AccountIDs != nil { + if ats != nil && ats.AccountIDs != nil { ats.AccountIDs = utils.NoDots(ats.AccountIDs) } if len(ats.ActionTimings) == 0 {