Skip to content

Commit

Permalink
Merge pull request #10524 from nextcloud/backport/10523/stable4.1
Browse files Browse the repository at this point in the history
[stable4.1] fix(notifications): Notifier::prepare() threw \InvalidArgumentExcepti…
  • Loading branch information
kesselb authored Dec 20, 2024
2 parents 79a5b79 + a7c3f8d commit 85381b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use OCP\L10N\IFactory;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
use OCP\Notification\UnknownNotificationException;

class Notifier implements INotifier {
private IFactory $factory;
Expand Down Expand Up @@ -41,7 +42,7 @@ public function getName(): string {
public function prepare(INotification $notification, string $languageCode): INotification {
if ($notification->getApp() !== Application::APP_ID) {
// Not my app => throw
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}

// Read the language from the notification
Expand Down Expand Up @@ -69,7 +70,7 @@ public function prepare(INotification $notification, string $languageCode): INot
]);
break;
default:
throw new \InvalidArgumentException();
throw new UnknownNotificationException();
}

return $notification;
Expand Down

0 comments on commit 85381b3

Please sign in to comment.