Fixed crash when uploading a file in any account after cleaning app data

This commit is contained in:
David A. Velasco 2013-01-10 11:39:22 +01:00
parent afa58b8ac6
commit 471bff2aec

View file

@ -69,6 +69,18 @@ public class FileDataStorageManager implements DataStorageManager {
file = createFileInstance(c);
}
c.close();
if (file == null && OCFile.PATH_SEPARATOR.equals(path)) {
return createRootDir(); // root should always exist
}
return file;
}
private OCFile createRootDir() {
OCFile file = new OCFile(OCFile.PATH_SEPARATOR);
file.setMimetype("DIR");
file.setParentId(DataStorageManager.ROOT_PARENT_ID);
saveFile(file);
return file;
}