From ad58d138145da504dd1fa1610c0ff797e43ce404 Mon Sep 17 00:00:00 2001
From: Simon Spannagel <simonspa@kth.se>
Date: Mon, 2 Nov 2020 17:58:23 +0100
Subject: [PATCH] UserStatus: no message means clear status message. This fixes
 #23332

Signed-off-by: Simon Spannagel <simonspa@kth.se>
---
 apps/user_status/lib/Controller/UserStatusController.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index 950cafb104d..0ca82e84cbd 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -135,10 +135,10 @@ class UserStatusController extends OCSController {
 	 * @throws OCSBadRequestException
 	 */
 	public function setCustomMessage(?string $statusIcon,
-									 string $message,
+									 ?string $message,
 									 ?int $clearAt): DataResponse {
 		try {
-			if ($message !== '') {
+			if ($message !== null && $message !== '') {
 				$status = $this->service->setCustomMessage($this->userId, $statusIcon, $message, $clearAt);
 			} else {
 				$this->service->clearMessage($this->userId);
-- 
GitLab