Skip to content

Commit a3c965f

Browse files
committed
fix: add null check before refreshing folder when receiving external files
1 parent df49420 commit a3c965f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎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)