Merge pull request #2387 from nextcloud/fileNotFound

OnServiceConnnected: File not found
This commit is contained in:
Andy Scherzinger 2018-03-22 14:11:38 +01:00 committed by GitHub
commit 958257ba74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -120,7 +120,8 @@ public class FileDataStorageManager {
}
public OCFile getFileById(long id) {
public @Nullable
OCFile getFileById(long id) {
Cursor c = getFileCursorForValue(ProviderTableMeta._ID, String.valueOf(id));
OCFile file = null;
if (c.moveToFirst()) {

View file

@ -1545,7 +1545,7 @@ public class FileDisplayActivity extends HookActivity
if (mWaitingToPreview != null && getStorageManager() != null) {
// update the file
mWaitingToPreview = getStorageManager().getFileById(mWaitingToPreview.getFileId());
if (!mWaitingToPreview.isDown()) {
if (mWaitingToPreview != null && !mWaitingToPreview.isDown()) {
requestForDownload();
}
}