From feedacc7b5e252bde995f979113ae5a960eebd1b Mon Sep 17 00:00:00 2001 From: Radu Ioan Fericean Date: Wed, 25 Nov 2015 13:28:42 +0200 Subject: [PATCH] protection against nil unit counter --- engine/account.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/account.go b/engine/account.go index 46602adcb..555545efc 100644 --- a/engine/account.go +++ b/engine/account.go @@ -753,6 +753,9 @@ func (acc *Account) AsOldStructure() interface{} { Disabled: acc.Disabled, } for i, uc := range acc.UnitCounters { + if uc == nil { + continue + } result.UnitCounters[i] = &UnitsCounter{ BalanceType: uc.BalanceType, Balances: make(BalanceChain, len(uc.Balances)),