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

[Possible Bug] Items with newlines in the user field crash the application #40

Closed
psfloyd opened this issue Feb 8, 2022 · 2 comments
Closed

Comments

@psfloyd
Copy link

psfloyd commented Feb 8, 2022

Hi, today I downloaded rofi-rbw, and had some problems getting it to work. The issue is resolved for my case now, but maybe it can lead to a bug fix in the code for the future. Or information for someone that has a similar problem.
I was getting this error:

Traceback (most recent call last):
  File "/usr/bin/rofi-rbw", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 231, in main
    RofiRbw().main()
  File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in main
    parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
  File "/usr/lib/python3.10/site-packages/rofi_rbw/rofi_rbw.py", line 132, in <listcomp>
    parsed_entries = [Entry.parse_rbw_output(it) for it in entries]
  File "/usr/lib/python3.10/site-packages/rofi_rbw/entry.py", line 33, in parse_rbw_output
    fields[1],
IndexError: list index out of range

I inspected the output of rbw ls --fields 'folder,name,user' as per this issue #38. And found that the output had some empty lines.
I do not know how, but for some reason I had an item in my bitwarden vault that had a newline in the user field. This was not intended, so I fixed this entry.
I could not replicate the entry in bitwarden. It is not possible to insert newlines on the user field.

But I think this might be an edge case to consider.

fdw added a commit that referenced this issue Feb 9, 2022
We cannot fail gracefully here, because we have no idea how to parse
that thing correctly. So, the next best thing is to throw a better error
message.

Issue: #40
@fdw
Copy link
Owner

fdw commented Feb 9, 2022

Thanks for that information! 🙂

I don't think rofi-rbw can do much here, as I have no idea what exactly is the problem with an incorrectly formatted line. I've tried at least to improve the error message a bit, so that at least it's easier to see what the problem is. But if you have a better idea, please share 🙂

@psfloyd
Copy link
Author

psfloyd commented Feb 12, 2022

Great!
A better error message is very helpful for this type of issue.
I'm going to close the issue, as it is resolved on my case.

@psfloyd psfloyd closed this as completed Feb 12, 2022
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

2 participants