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

Panic while selecting directory inside my Oneplus 8 #4

Closed
PvdBerg1998 opened this issue Nov 22, 2020 · 1 comment
Closed

Panic while selecting directory inside my Oneplus 8 #4

PvdBerg1998 opened this issue Nov 22, 2020 · 1 comment

Comments

@PvdBerg1998
Copy link

PvdBerg1998 commented Nov 22, 2020

When I select a directory inside my Oneplus 8, I'm getting the following panic:
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /cargo/registry/src/github.com-1ecc6299db9ec823/wfd-0.1.4/src/lib.rs:281:29
I think it is probably related to the fact that the phone is using some special protocol to provide access to its internal files. I forgot the name. It also shows up as a different icon in explorer. Let me know if you need more information.

Edit: it's MTP

@ben-wallis
Copy link
Owner

ben-wallis commented Dec 10, 2020

0.1.6 has been released to fix this panic, selecting such a file or folder will now return an UnsupportedFilepath error. MTP / WPD (Windows Portable Devices) files and folders don't have real file paths, they have a "path" that looks like this:

::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\\\\?\\usb#vid_04e8&pid_6860&ms_comp_mtp&samsung_android#a&15e77d79&0&0000#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\\SID-{20002,SECZ9519043CHOHB01,63829639168}\\{C27B1D59-9037-D40C-182E-86C238D7B031}\\{5AC5A7C4-5BE4-B798-6FB5-2ED49B359493}

It is possible to write code to consume these WPD paths but unless someone else wants to investigate/implement correct handling of these an error is better than a panic for now.

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