sabre-io / dav

sabre/dav is a CalDAV, CardDAV and WebDAV framework for PHP
http://sabre.io
BSD 3-Clause "New" or "Revised" License
1.54k stars 347 forks source link

Cant remove event if recipient is null : exception #1541

Open dominiquefournier opened 9 months ago

dominiquefournier commented 9 months ago

I have an event were the recipient is null. I can not remove this event as an exception is raised.

After analysis, I create this patch to solve the problem :

--- vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php.ori 2024-02-01 20:17:06.509023419 +0100
+++ vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php 2024-02-01 20:16:53.136307540 +0100
@@ -414,6 +414,9 @@

         $caldavNS = '{'.self::NS_CALDAV.'}';

+        if (is_null($iTipMessage->recipient)) {
+            return;
+        }
         $principalUri = $aclPlugin->getPrincipalByUri($iTipMessage->recipient);
         if (!$principalUri) {
             $iTipMessage->scheduleStatus = '3.7;Could not find principal.';

I don't know how submit a PR, but I hope it will help you.