From 9fd2b6045d2ab613a9bf73dce50610da611be2ef Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 5 Jan 2021 10:08:14 +0100 Subject: [PATCH] Don't throw a 500 when importing a broken ics reminder file Signed-off-by: Joas Schilling --- apps/dav/lib/CalDAV/Reminder/ReminderService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php index 688b4ce610..9c27231cb8 100644 --- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php +++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php @@ -40,6 +40,7 @@ use OCP\IUserManager; use Sabre\VObject; use Sabre\VObject\Component\VAlarm; use Sabre\VObject\Component\VEvent; +use Sabre\VObject\InvalidDataException; use Sabre\VObject\ParseException; use Sabre\VObject\Recur\EventIterator; use Sabre\VObject\Recur\NoInstancesException; @@ -274,7 +275,11 @@ class ReminderService { continue; } - $triggerTime = $valarm->getEffectiveTriggerTime(); + try { + $triggerTime = $valarm->getEffectiveTriggerTime(); + } catch (InvalidDataException $e) { + continue; + } // If effective trigger time is in the past // just skip and generate for next event