fix potential crash in Google Drive storage
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user