and3rson/clay

Crash when hitting down

lpwisniewski opened this issue · 4 comments

I was typing in the search bar, and then hit the down button of my keyboard. The CLI crashed and this stacktrace appear:

Traceback (most recent call last):
  File "/home/metaheavens/.local/bin/clay", line 11, in <module>
    load_entry_point('clay-player==1.0.0', 'console_scripts', 'clay')()
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/app.py", line 371, in main
    loop.run()
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 286, in run
    self._run()
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 384, in _run
    self.event_loop.run()
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 788, in run
    self._loop()
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 825, in _loop
    self._watch_files[fd]()
  File "/usr/lib/python3.6/site-packages/urwid/raw_display.py", line 404, in <lambda>
    event_loop, callback, self.get_available_raw_input())
  File "/usr/lib/python3.6/site-packages/urwid/raw_display.py", line 502, in parse_input
    callback(processed, processed_codes)
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 411, in _update
    self.process_input(keys)
  File "/usr/lib/python3.6/site-packages/urwid/main_loop.py", line 511, in process_input
    k = self._topmost_widget.keypress(self.screen_size, k)
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/app.py", line 232, in keypress
    hotkey_manager.keypress("global", self, super(AppWidget, self), size, key)
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/hotkeys.py", line 139, in keypress
    ret = super_.keypress(size, key)
  File "/usr/lib/python3.6/site-packages/urwid/container.py", line 1131, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/usr/lib/python3.6/site-packages/urwid/container.py", line 2271, in keypress
    key = w.keypress((mc,) + size[1:], key)
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/songlist.py", line 614, in keypress
    size, key)
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/hotkeys.py", line 137, in keypress
    ret = getattr(caller, method_name)()
  File "/home/metaheavens/.local/lib/python3.6/site-packages/clay/songlist.py", line 645, in move_up
    matches, index = self._get_filtered()
TypeError: 'bool' object is not iterable

Tried to reproduce this and it seems to only happen if there are no hits.

Could you try the filter-hotfix branch and see if that solves the issue?

The bug stays on filter-hotfix.

I really can't reproduce this, so I am going to file a merge request because that works on my machines (tm) and should hopefully fix it for someone other people.
If someone can reproduce in some way, please let me know!