diff --git a/src/app/utils/steemApi.js b/src/app/utils/steemApi.js index 0102f98adfa01bf7a59386b0457829d2039163fb..5169d5afd0027e78e4dbc19f004d1a24516e369f 100644 --- a/src/app/utils/steemApi.js +++ b/src/app/utils/steemApi.js @@ -1,4 +1,5 @@ import { api } from '@hiveio/hive-js'; +import _ from 'lodash'; import { ifHive } from 'app/utils/Community'; import stateCleaner from 'app/redux/stateCleaner'; import { @@ -28,8 +29,11 @@ export function getHivePowerForUser(account) { 'database_api.find_accounts', { accounts: [account] } ); - const post_voting_power = - fullAccounts['accounts'][0]['post_voting_power']; + const post_voting_power = _.get( + fullAccounts, + 'accounts[0].post_voting_power', + 0 + ); /** * This magic number is coming from * https://gitlab.syncad.com/hive/hivemind/-/blame/d2d5ef25107908db09438da5ee3da9d6fcb976bc/hive/server/bridge_api/objects.py