mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 02:56:24 +05:00
Check if RoundingDecimals is nil before loading
This prevents the nil pointer dereference panic occuring when not set it is not set.
This commit is contained in:
committed by
Dan Christian Bogos
parent
a2633a7fd7
commit
e06fc9eb8d
@@ -197,8 +197,10 @@ func (fc *FCTemplate) Clone() *FCTemplate {
|
||||
cln.BreakOnSuccess = fc.BreakOnSuccess
|
||||
cln.Layout = fc.Layout
|
||||
cln.CostShiftDigits = fc.CostShiftDigits
|
||||
cln.RoundingDecimals = new(int)
|
||||
*cln.RoundingDecimals = *fc.RoundingDecimals
|
||||
if fc.RoundingDecimals != nil {
|
||||
cln.RoundingDecimals = new(int)
|
||||
*cln.RoundingDecimals = *fc.RoundingDecimals
|
||||
}
|
||||
cln.MaskDestID = fc.MaskDestID
|
||||
cln.MaskLen = fc.MaskLen
|
||||
return cln
|
||||
|
||||
Reference in New Issue
Block a user