From 30979050bb03fb21fa8e1ed409dd87bdbb8abd74 Mon Sep 17 00:00:00 2001 From: Juan Carlos Garrote Date: Wed, 21 Feb 2024 14:54:23 +0100 Subject: [PATCH] Add safety condition to retrieve the current account in case the account in FolderPickerActivity is null (shouldn't happen in normal situations) --- .../com/owncloud/android/ui/activity/FolderPickerActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt index 48ff6e958ea..cb6e68b4b4f 100644 --- a/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt +++ b/owncloudApp/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt @@ -238,6 +238,9 @@ open class FolderPickerActivity : FileActivity(), private fun initAndShowListOfFilesFragment(spaceId: String? = null) { val safeInitialFolder = if (file == null) { + if (account == null) { + account = AccountUtils.getCurrentOwnCloudAccount(applicationContext) + } val fileDataStorageManager = FileDataStorageManager(account) fileDataStorageManager.getFileByPath(OCFile.ROOT_PATH, spaceId) } else {