Delete accountID only if it exist

This commit is contained in:
rbarrabe
2016-11-22 10:54:44 +01:00
committed by GitHub
parent 9b34f98521
commit 20d2cee425

View File

@@ -567,7 +567,7 @@ func removeAccountAction(ub *Account, sq *StatsQueueTriggered, a *Action, acs Ac
}
//var dirtyAps []string
for key, ap := range allAPs {
if _, exists := ap.AccountIDs[accID]; !exists {
if _, exists := ap.AccountIDs[accID]; exists {
// save action plan
delete(ap.AccountIDs, key)
ratingStorage.SetActionPlan(key, ap, true, utils.NonTransactional)