Skip to content

Commit

Permalink
Merge pull request #36210 from nextcloud/fix/4811/principal-email
Browse files Browse the repository at this point in the history
fix(dav): check if principal has email address before accessing it
  • Loading branch information
kesselb authored Jan 26, 2023
2 parents 033b03d + bbda231 commit 0a54817
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/dav/lib/Connector/Sabre/Principal.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ public function getCircleMembership($principal):array {
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'])) {
Expand Down

0 comments on commit 0a54817

Please sign in to comment.