From bbda231e18caede2899b045f34e02e139b038409 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 18 Jan 2023 12:10:49 +0100 Subject: [PATCH] fix(dav): check if principal has email address before accessing it Ref https://github.com/nextcloud/calendar/issues/4811 Signed-off-by: Richard Steinmetz --- apps/dav/lib/Connector/Sabre/Principal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php index 7b4b7090832..0a882288314 100644 --- a/apps/dav/lib/Connector/Sabre/Principal.php +++ b/apps/dav/lib/Connector/Sabre/Principal.php @@ -617,8 +617,8 @@ class Principal implements BackendInterface { public function getEmailAddressesOfPrincipal(array $principal): array { $emailAddresses = []; - if (($primaryAddress = $principal['{http://sabredav.org/ns}email-address'])) { - $emailAddresses[] = $primaryAddress; + if (isset($principal['{http://sabredav.org/ns}email-address'])) { + $emailAddresses[] = $principal['{http://sabredav.org/ns}email-address']; } if (isset($principal['{DAV:}alternate-URI-set'])) { -- 2.39.5