]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(dav): check if principal has email address before accessing it 36210/head
authorRichard Steinmetz <richard@steinmetz.cloud>
Wed, 18 Jan 2023 11:10:49 +0000 (12:10 +0100)
committerRichard Steinmetz <richard@steinmetz.cloud>
Tue, 24 Jan 2023 08:27:53 +0000 (09:27 +0100)
Ref https://github.com/nextcloud/calendar/issues/4811

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
apps/dav/lib/Connector/Sabre/Principal.php

index 7b4b70908327e58e9d1cb1a020dfa1b0b51d32e2..0a88228831421f2932b46a379df9c20cd3a5bf2e 100644 (file)
@@ -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'])) {