Skip to content

Commit 3199a17

Browse files
authored
Merge pull request #3696 from owncloud/fix/crash_details_open
Fix crash when opening a non downloaded file from Details view
2 parents d597c86 + e116832 commit 3199a17

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
Changelog for ownCloud Android Client [unreleased] (UNRELEASED)
2+
=======================================
3+
The following sections list the changes in ownCloud Android Client unreleased relevant to
4+
ownCloud admins and users.
5+
6+
[unreleased]: https://github.com/owncloud/android/compare/v2.21.0...master
7+
8+
Summary
9+
-------
10+
11+
* Bugfix - Fix crash when opening from details screen: [#3696](https://github.com/owncloud/android/pull/3696)
12+
13+
Details
14+
-------
15+
16+
* Bugfix - Fix crash when opening from details screen: [#3696](https://github.com/owncloud/android/pull/3696)
17+
18+
Fixed a crash when opening a non downloaded file from the details view.
19+
20+
https://github.com/owncloud/android/pull/3696
21+
122
Changelog for ownCloud Android Client [2.21.0] (2022-06-07)
223
=======================================
324
The following sections list the changes in ownCloud Android Client 2.21.0 relevant to

changelog/unreleased/3696

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Bugfix: Fix crash when opening from details screen
2+
3+
Fixed a crash when opening a non downloaded file from the details view.
4+
5+
https://github.com/owncloud/android/pull/3696

owncloudApp/src/main/java/com/owncloud/android/ui/fragment/FileDetailFragment.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ public boolean onOptionsItemSelected(MenuItem item) {
281281
return true;
282282
}
283283
case R.id.action_open_file_with: {
284-
mContainerActivity.getFileOperationsHelper().openFile(getFile());
284+
if (!getFile().isDown()) { // Download the file
285+
Timber.d("%s : File must be downloaded before opening", getFile().getRemotePath());
286+
((FileDisplayActivity) mContainerActivity).startDownloadForOpening(getFile());
287+
} else {
288+
mContainerActivity.getFileOperationsHelper().openFile(getFile());
289+
}
285290
return true;
286291
}
287292
case R.id.action_remove_file: {
@@ -305,7 +310,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
305310
}
306311
case R.id.action_send_file: {
307312
// Obtain the file
308-
if (!getFile().isDown()) { // Download the file
313+
if (!getFile().isDown()) { // Download the file
309314
Timber.d("%s : File must be downloaded", getFile().getRemotePath());
310315
((FileDisplayActivity) mContainerActivity).startDownloadForSending(getFile());
311316
} else {

0 commit comments

Comments
 (0)