aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_status/lib/Controller/UserStatusController.php
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-12-11 10:23:02 +0100
committerprovokateurin <kate@provokateurin.de>2024-12-18 10:52:41 +0100
commit5c360e0367da488febba66325082158725207801 (patch)
tree9a3a8d9757fc98023ede8fbc2892a1eeda3dc6f1 /apps/user_status/lib/Controller/UserStatusController.php
parent654a7d22ff714c4a5a0769bb9d32a509cbb39ac3 (diff)
downloadnextcloud-server-5c360e0367da488febba66325082158725207801.tar.gz
nextcloud-server-5c360e0367da488febba66325082158725207801.zip
fix(user_status): Catch non-existing user status when setting custom user status
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/user_status/lib/Controller/UserStatusController.php')
-rw-r--r--apps/user_status/lib/Controller/UserStatusController.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index da39710b3fb..9b3807ce86e 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -123,6 +123,7 @@ class UserStatusController extends OCSController {
* @param int|null $clearAt When the message should be cleared
* @return DataResponse<Http::STATUS_OK, UserStatusPrivate, array{}>
* @throws OCSBadRequestException The clearAt or icon is invalid or the message is too long
+ * @throws OCSNotFoundException No status for the current user
*
* 200: The message was updated successfully
*/
@@ -149,6 +150,8 @@ class UserStatusController extends OCSController {
} catch (StatusMessageTooLongException $ex) {
$this->logger->debug('New user-status for "' . $this->userId . '" was rejected due to a too long status message.');
throw new OCSBadRequestException($ex->getMessage(), $ex);
+ } catch (DoesNotExistException $ex) {
+ throw new OCSNotFoundException('No status for the current user');
}
}