From 088cd08fd85e8d980ab48b6688a144ff0688934c Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 18 Feb 2021 16:40:27 +0100 Subject: Make sure an account exists before updating it Signed-off-by: Christoph Wurst --- lib/Controller/AccountsController.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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 { -- cgit v1.2.3