Skip to content

Commit

Permalink
Check balance sections length before accessing sections data
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchung committed Apr 22, 2020
1 parent 36a491d commit 02cdce3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/helpers/buildWalletSections.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,15 @@ const coinEditContextMenu = (
allAssetsCount,
totalValue
) => {
const noSmallBalances = !(
balanceSectionData[balanceSectionData.length - 1].smallBalancesContainer ||
(balanceSectionData.length > 1 &&
balanceSectionData[balanceSectionData.length - 2].smallBalancesContainer)
);
const noSmallBalances =
!balanceSectionData.length ||
!(
balanceSectionData[balanceSectionData.length - 1]
.smallBalancesContainer ||
(balanceSectionData.length > 1 &&
balanceSectionData[balanceSectionData.length - 2]
.smallBalancesContainer)
);
return {
contextMenuOptions:
allAssets.length <= amountOfShowedCoins && noSmallBalances
Expand Down

0 comments on commit 02cdce3

Please sign in to comment.