Skip to content

Commit

Permalink
fix cannot read propery constructor of undefined (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bitcoinera authored Feb 13, 2020
1 parent ccfd04d commit 0335ea1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/reducers/cosmosV0-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,12 @@ function overviewReducer(

return {
rewards:
rewards[0].constructor === Array
? reducers.rewardReducer(rewards)
: rewards,
// there are some accounts which are not staking and therefore have no rewards
rewards[0]
? rewards[0].constructor === Array
? reducers.rewardReducer(rewards)
: rewards
: null,
totalRewards: totalRewards,
liquidStake: liquidStake,
totalStake: liquidStake.plus(delegatedStake).plus(undelegatingStake)
Expand Down

0 comments on commit 0335ea1

Please sign in to comment.