public void onReceive(Context context, Intent intent) {\r
String downloadedRemotePath = intent.getStringExtra(FileDownloader.EXTRA_REMOTE_PATH);\r
String accountName = intent.getStringExtra(FileDownloader.ACCOUNT_NAME);\r
-\r
+ OCFile downloadedFile = mStorageManager.getFileByPath(downloadedRemotePath); // if null, the file is not in the current account, OR WAS DELETED before the download finished \r
+ \r
if (accountName.equals(AccountUtils.getCurrentOwnCloudAccount(context).name) &&\r
- mCurrentDir != null && mCurrentDir.getFileId() == mStorageManager.getFileByPath(downloadedRemotePath).getParentId()) {\r
+ mCurrentDir != null && downloadedFile != null &&\r
+ mCurrentDir.getFileId() == downloadedFile.getParentId()) {\r
OCFileListFragment fileListFragment = (OCFileListFragment) getSupportFragmentManager().findFragmentById(R.id.fileList);\r
if (fileListFragment != null) { \r
fileListFragment.listDirectory();\r