Merge pull request #24972 from nextcloud/backport/24964/stable20

[stable20] Don't throw a 500 when importing a broken ics reminder file
This commit is contained in:
Roeland Jago Douma 2021-01-07 09:08:11 +01:00 committed by GitHub
commit 9e6cc31f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}
try {
$triggerTime = $valarm->getEffectiveTriggerTime();
} catch (InvalidDataException $e) {
continue;
}
// If effective trigger time is in the past
// just skip and generate for next event