Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-02-19 11:41:59 +0300
committerGitHub <noreply@github.com>2021-02-19 11:41:59 +0300
commit026bfc467ad6170b9c09292a9acf49b7e60211eb (patch)
tree22309c59b1191fc4fa22745f02e6f904cccd0bdc /lib
parent324ddd3e0b4cce10da8f31172b91349170d214e9 (diff)
parent088cd08fd85e8d980ab48b6688a144ff0688934c (diff)
Merge pull request #4559 from nextcloud/fix/check-account-update-account-existence
Make sure an account exists before updating it
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/AccountsController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Controller/AccountsController.php b/lib/Controller/AccountsController.php
index 9c79668e9..be4ba7602 100644
--- a/lib/Controller/AccountsController.php
+++ b/lib/Controller/AccountsController.php
@@ -194,6 +194,13 @@ class AccountsController extends Controller {
string $smtpSslMode = null,
string $smtpUser = null,
string $smtpPassword = null): JSONResponse {
+ try {
+ // Make sure the account actually exists
+ $this->accountService->find($this->currentUserId, $id);
+ } catch (ClientException $e) {
+ return new JSONResponse([], Http::STATUS_BAD_REQUEST);
+ }
+
$account = null;
$errorMessage = null;
try {