OnServiceConnnected: File not found
@@ -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()) {
@@ -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();