Skip to content

Commit

Permalink
fix: TypeError: Cannot read properties of undefined (reading 'currenc…
Browse files Browse the repository at this point in the history
…y') (#3216)

* fix: TypeError: Cannot read properties of undefined (reading 'currency')

* fix: improving code
  • Loading branch information
Z3RO-O committed Sep 26, 2024
1 parent 8753802 commit 9720ddd
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9720ddd

Please sign in to comment.