Skip to content

Commit

Permalink
bug: return zero from get_historical_balance when historical balance …
Browse files Browse the repository at this point in the history
…is not present
  • Loading branch information
Jaguar0625 committed Dec 2, 2021
1 parent ed3bcba commit 63d99c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/NemClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_account_info(self, address, forwarded=False):
def get_historical_balance(self, address, height):
rest_path = f'account/historical/get?address={address}&startHeight={height}&endHeight={height}&increment=1'
json_response = self._get_json(rest_path)
return float(json_response['data'][0]['balance']) / MICROXEM_PER_XEM
return 0 if not json_response['data'] else float(json_response['data'][0]['balance']) / MICROXEM_PER_XEM

def get_harvests(self, address, start_id=None):
json_response = self._get_account_page('harvests', address, start_id)
Expand Down

0 comments on commit 63d99c2

Please sign in to comment.