Skip to content

Commit 73c58a0

Browse files
authored
Merge pull request #2604 from nextcloud/fix/nc39/notification-generator-invalid-argument-exception
fix(NotificationGenerator): catch InvalidArgumentException from notification setters in prepare()
2 parents 2ee3ba8 + 2c05121 commit 73c58a0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/NotificationGenerator.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ public function prepare(INotification $notification, string $languageCode): INot
118118
$event = $this->populateEvent($event, $languageCode);
119119
$this->activityManager->setCurrentUserId(null);
120120

121-
return $this->getDisplayNotificationForEvent($event, $event->getObjectId());
121+
try {
122+
return $this->getDisplayNotificationForEvent($event, $event->getObjectId());
123+
} catch (\InvalidArgumentException $e) {
124+
$this->logger->error('Failed to format activity notification', ['exception' => $e]);
125+
throw new AlreadyProcessedException();
126+
}
122127
}
123128

124129
private function getDisplayNotificationForEvent(IEvent $event, int $activityId): INotification {

0 commit comments

Comments
 (0)