Skip to content

Commit 9cc4f03

Browse files
committed
inform user if account not exists
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 3e6d5dc commit 9cc4f03

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,16 +3081,14 @@ class FileDisplayActivity :
30813081
intent,
30823082
object : AccountReceiverCallback {
30833083
override fun onAccountReceived(accountName: String) {
3084-
val user = accountManager.getUser(accountName)
3085-
if (user.isEmpty) {
3086-
Log_OC.e(TAG, "user is not present")
3087-
DisplayUtils.showSnackMessage(this@FileDisplayActivity, R.string.account_not_found)
3088-
return
3089-
}
3084+
val account = accountManager.getUser(accountName).orElse(null)
3085+
?: run {
3086+
Log_OC.w(TAG, "user is not present")
3087+
DisplayUtils.showSnackMessage(this@FileDisplayActivity, R.string.account_not_found)
3088+
return
3089+
}
30903090

3091-
if (user.isPresent) {
3092-
accountClicked(user.get())
3093-
}
3091+
accountClicked(account)
30943092
}
30953093

30963094
override fun onAccountError(reason: String) {

0 commit comments

Comments
 (0)