From: David A. Velasco Date: Thu, 22 Nov 2012 09:51:54 +0000 (+0100) Subject: Fixed crash when a folder is deleted while some of its contained files is downloading X-Git-Tag: oc-android-1.4.3~88^2~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/7fa988573879b20ecb457f8739bbd02efbd4bf7d?ds=inline;hp=--cc Fixed crash when a folder is deleted while some of its contained files is downloading --- 7fa988573879b20ecb457f8739bbd02efbd4bf7d diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index ffbbb887..49370e5d 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -902,9 +902,11 @@ public class FileDisplayActivity extends SherlockFragmentActivity implements public void onReceive(Context context, Intent intent) { String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH); String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME); - + OCFile downloadedFile = mStorageManager.getFileByPath(downloadedRemotePath); // if null, the file is not in the current account, OR WAS DELETED before the download finished + if (accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name) && - mCurrentDir != null && mCurrentDir.getFileId() == mStorageManager.getFileByPath(downloadedRemotePath).getParentId()) { + mCurrentDir != null && downloadedFile != null && + mCurrentDir.getFileId() == downloadedFile.getParentId()) { OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList); if (fileListFragment != null) { fileListFragment.listDirectory();