Skip to content

Commit

Permalink
Merge pull request #688 from nextcloud/backport/686/stable-2.7
Browse files Browse the repository at this point in the history
[stable-2.7] Throw AccountNotFoundException when username or password cannot be retrieved
  • Loading branch information
tobiasKaminsky authored Aug 11, 2021
2 parents 811040d + 2c74e07 commit 98a8176
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ public static NextcloudClient createNextcloudClient(Account account, Context app
String username = AccountUtils.getUsernameForAccount(account);
String password = am.peekAuthToken(account, AccountTypeUtils.getAuthTokenTypePass(account.type));

if (username == null || username.isEmpty() || password == null || password.isEmpty()) {
throw new AccountNotFoundException(
account,
"Username or password could not be retrieved",
null);
}

// Restore cookies
// TODO v2 cookie handling
// AccountUtils.restoreCookies(account, client, appContext);
Expand Down

0 comments on commit 98a8176

Please sign in to comment.