Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty case list handling causes curitz traceback #3

Open
runborg opened this issue Mar 25, 2024 · 0 comments
Open

Empty case list handling causes curitz traceback #3

runborg opened this issue Mar 25, 2024 · 0 comments

Comments

@runborg
Copy link
Contributor

runborg commented Mar 25, 2024

When you have a completely empty case-list, eg. after filtering with a random nonexistant string.
if you then press "[ENTER]", this tracebacks curitz with the error:

Traceback (most recent call last):
  File "/home/runarb/.local/bin/curitz", line 8, in <module>
    sys.exit(main())
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 1182, in main
    curses.wrapper(uiloop, config)
  File "/usr/lib/python3.10/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 404, in uiloop
    runner(screen, config)
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/cli.py", line 845, in runner
    uiShowHistory(screen, lb.active.id, config)
  File "/home/runarb/.local/pipx/venvs/curitz/lib/python3.10/site-packages/curitz/culistbox.py", line 118, in active
    return self.elements[self.active_element]
IndexError: list index out of range

This should instead just do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant