mirror of
https://github.com/moparisthebest/keepass2android
synced 2025-02-16 15:00:12 -05:00
Gdrive: fixed possible exception when listing files of root folder
This commit is contained in:
parent
740e642965
commit
97e98f8804
@ -181,7 +181,12 @@ public class GoogleDriveFileStorage extends JavaFileStorageBase {
|
|||||||
if (!path.startsWith(getProtocolPrefix()))
|
if (!path.startsWith(getProtocolPrefix()))
|
||||||
throw new InvalidPathException("Invalid path: "+path);
|
throw new InvalidPathException("Invalid path: "+path);
|
||||||
String pathWithoutProtocol = path.substring(getProtocolPrefix().length());
|
String pathWithoutProtocol = path.substring(getProtocolPrefix().length());
|
||||||
String accountNameEncoded = pathWithoutProtocol.substring(0, pathWithoutProtocol.indexOf("/"));
|
int slashPos = pathWithoutProtocol.indexOf("/");
|
||||||
|
String accountNameEncoded;
|
||||||
|
if (slashPos < 0)
|
||||||
|
accountNameEncoded = pathWithoutProtocol;
|
||||||
|
else
|
||||||
|
accountNameEncoded = pathWithoutProtocol.substring(0, slashPos);
|
||||||
return decode(accountNameEncoded);
|
return decode(accountNameEncoded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,7 +195,7 @@ public class GoogleDriveFileStorage extends JavaFileStorageBase {
|
|||||||
//gdrive://
|
//gdrive://
|
||||||
String displayName = getProtocolPrefix();
|
String displayName = getProtocolPrefix();
|
||||||
|
|
||||||
//gdrive//me@google.com/
|
//gdrive://me@google.com/
|
||||||
|
|
||||||
displayName += mAccount;
|
displayName += mAccount;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user