BenjiLee / PoloniexAnalyzer

Trade history and balance analyzer for Poloniex
MIT License
78 stars 22 forks source link

IndexError: list index out of range #60

Open Ashkaan opened 6 years ago

Ashkaan commented 6 years ago

Hi,

Every other function works great, but when I run "GetLendingHistory", I get:

Traceback (most recent call last):
  File "poloniex.py", line 73, in <module>
    main()
  File "poloniex.py", line 65, in main
    actions[args.action]['function']()
  File "/home/ashkaan/PoloniexAnalyzer-master/analyzer.py", line 158, in get_lending_history
    lending_history = LendingHistory()
  File "/home/ashkaan/PoloniexAnalyzer-master/poloniex_apis/api_models/lending_history.py", line 11, in __init__
    self.history = self._get_all_lending_history()
  File "/home/ashkaan/PoloniexAnalyzer-master/poloniex_apis/api_models/lending_history.py", line 19, in _get_all_lending_history
    returned_end_time = create_time_stamp(lending_history[-1]['close'])
IndexError: list index out of range
BenjiLee commented 6 years ago

Dumb question coming up. Have you used the lending feature on Polo with your account?

Ashkaan commented 6 years ago

How embarrassing. It seems that your question is the smart one and mine is the dumb one.

BenjiLee commented 6 years ago

Still a valid question. It just means I didn't handle the case where an account didn't have any lending history. The appropriate error message should appear.

Reopening. I will add the correct message. Thanks for the report :D