From 3065b8c61efa4cc6244e050fe934878104036b14 Mon Sep 17 00:00:00 2001 From: nthduc95 Date: Fri, 21 Jul 2023 13:05:57 +0700 Subject: [PATCH] add check length --- src/components/account/services/account.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/account/services/account.service.ts b/src/components/account/services/account.service.ts index 60aaf40e..1d227f64 100644 --- a/src/components/account/services/account.service.ts +++ b/src/components/account/services/account.service.ts @@ -126,7 +126,7 @@ export class AccountService { delegation.amount = this.changeUauraToAura(item.balance.amount); if ( reward.length > 0 && - reward[0].reward.length > 0 && + reward[0].reward?.length > 0 && reward[0].reward[0].denom === this.minimalDenom ) { delegation.reward = this.changeUauraToAura( @@ -237,6 +237,7 @@ export class AccountService { ); if ( commissionData && + commissionData.commission?.commission?.length > 0 && commissionData.commission.commission[0].denom === this.minimalDenom ) { commission = commissionData.commission.commission[0].amount;