Skip to content

Commit 24adadd

Browse files
authored
Merge pull request #4878 from owncloud/fix/refresh_folder_crash_from_play_console
[FIX] Play console crash: NPE refreshFolderUseCase
2 parents df49420 + c548b23 commit 24adadd

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎changelog/unreleased/4878‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Bugfix: Crash from Google Play Console in ReceiveExternalFilesActivity
2+
3+
In order to prevent crashes, a nullability check has been added before
4+
refreshing a not found folder while receiving external files.
5+
6+
https://github.com/owncloud/android/issues/4738
7+
https://github.com/owncloud/android/pull/4878

‎owncloudApp/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author Jorge Aguado Recio
1414
*
1515
* Copyright (C) 2012 Bartek Przybylski
16-
* Copyright (C) 2025 ownCloud GmbH.
16+
* Copyright (C) 2026 ownCloud GmbH.
1717
* <p>
1818
* This program is free software: you can redistribute it and/or modify
1919
* it under the terms of the GNU General Public License version 2,
@@ -459,7 +459,13 @@ public void onBackPressed() {
459459
} else {
460460
mParents.pop();
461461
String full_path = generatePath(mParents);
462-
startSyncFolderOperation(getStorageManager().getFileByPath(full_path, currentSpaceId));
462+
OCFile folder = getStorageManager().getFileByPath(full_path, currentSpaceId);
463+
if (folder == null) {
464+
Timber.i("Folder %s not found, fetching the folder again.", full_path);
465+
super.onBackPressed();
466+
return;
467+
}
468+
startSyncFolderOperation(folder);
463469
updateDirectoryList();
464470
if (mParents.size() <= 1 && !areSpacesAllowed) {
465471
updateToolbar(getString(R.string.uploader_top_message));

0 commit comments

Comments
 (0)