BenjiLee/PoloniexAnalyzer

IndexError: list index out of range

Ashkaan opened this issue · 3 comments

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

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

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

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