fix potential crash in Google Drive storage

This commit is contained in:
Philipp Crocoll
2019-04-10 06:01:22 +02:00
parent d0749324c9
commit b0f61038e3

View File

@@ -190,12 +190,14 @@ public class GoogleDriveFileStorage extends JavaFileStorageBase {
String part = parts[parts.length-1];
logDebug("parsing part " + part);
int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP);
String name = "";
if (indexOfSeparator < 0)
{
//seems invalid, but we're very generous here
displayName += "/"+part;
}
String name = part.substring(0, indexOfSeparator);
else
name = part.substring(0, indexOfSeparator);
try {
name = decode(name);
} catch (UnsupportedEncodingException e) {