From c5ec16d93777e6a528db34ea59f59d6602cf3351 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 17 Jul 2025 10:28:03 +0200 Subject: [PATCH 1/2] fix(ExAppNotifier): First check if any exapps enabled To avoid unnecessary work and logs Signed-off-by: Marcel Klehr --- lib/Notifications/ExAppNotifier.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Notifications/ExAppNotifier.php b/lib/Notifications/ExAppNotifier.php index ac25b0237..cf2081a40 100644 --- a/lib/Notifications/ExAppNotifier.php +++ b/lib/Notifications/ExAppNotifier.php @@ -36,6 +36,9 @@ public function getName(): string { } public function prepare(INotification $notification, string $languageCode): INotification { + if (count($this->service->getExAppsList()) === 0) { + throw new UnknownNotificationException(); + } $exApp = $this->service->getExApp($notification->getApp()); if ($exApp === null) { throw new UnknownNotificationException(); From f1adee0d99595f76a513321bed2c12f104edf6f5 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 17 Jul 2025 10:46:33 +0200 Subject: [PATCH 2/2] fix(ExAppNotifier): Use empty() instead of count() more performant Signed-off-by: Marcel Klehr --- lib/Notifications/ExAppNotifier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Notifications/ExAppNotifier.php b/lib/Notifications/ExAppNotifier.php index cf2081a40..34e237de1 100644 --- a/lib/Notifications/ExAppNotifier.php +++ b/lib/Notifications/ExAppNotifier.php @@ -36,7 +36,7 @@ public function getName(): string { } public function prepare(INotification $notification, string $languageCode): INotification { - if (count($this->service->getExAppsList()) === 0) { + if (empty($this->service->getExAppsList())) { throw new UnknownNotificationException(); } $exApp = $this->service->getExApp($notification->getApp());