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 <christoph@winzerhof-wurst.at>2021-02-18 18:40:27 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-02-19 11:04:33 +0300
commit088cd08fd85e8d980ab48b6688a144ff0688934c (patch)
treec8bed008354f3360783170a34ea11102e564f38d /lib
parent5caa3cead38dcb90dc95652498a07d00c2e012df (diff)
Make sure an account exists before updating it
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
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 {