mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 02:56:24 +05:00
protection against nil unit counter
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user