diff --git a/src/app/shared/components/fy-currency/fy-currency.component.ts b/src/app/shared/components/fy-currency/fy-currency.component.ts index 88ff260d8e..f5c77f2401 100644 --- a/src/app/shared/components/fy-currency/fy-currency.component.ts +++ b/src/app/shared/components/fy-currency/fy-currency.component.ts @@ -178,8 +178,7 @@ export class FyCurrencyComponent implements ControlValueAccessor, OnInit, OnChan showAutoCodeMessage(): void { const { currency, amount } = this.autoCodedData || {}; - const formCurrency = (this.fg?.value as CurrencyAmountFormValues).currency; - const formAmount = (this.fg?.value as CurrencyAmountFormValues).amount; + const { currency: formCurrency, amount: formAmount } = (this.fg?.value as CurrencyAmountFormValues) || {}; const isCurrencyAutoCoded = currency && currency === formCurrency; const isAmountAutoCoded = amount && amount === formAmount;