use OCA\FilesReminders\AppInfo\Application;
use OCA\FilesReminders\Exception\NodeNotFoundException;
use OCA\FilesReminders\Service\ReminderService;
+use OCP\AppFramework\Db\DoesNotExistException;
use OCP\Files\FileInfo;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
switch ($notification->getSubject()) {
case 'reminder-due':
$reminderId = (int)$notification->getObjectId();
- $node = $this->reminderService->get($reminderId)->getNode();
+ try {
+ $reminder = $this->reminderService->get($reminderId);
+ } catch (DoesNotExistException $e) {
+ throw new InvalidArgumentException();
+ }
+ $node = $reminder->getNode();
$path = rtrim($node->getPath(), '/');
if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) {
// Remove /user/files/...
protected LoggerInterface $logger,
) {}
+ /**
+ * @throws DoesNotExistException
+ */
public function get(int $id): RichReminder {
$reminder = $this->reminderMapper->find($id);
return new RichReminder($reminder, $this->root);