Skip to content

Commit

Permalink
Merge pull request #36387 from nextcloud/backport/36210/stable25
Browse files Browse the repository at this point in the history
[stable25] fix(dav): check if principal has email address before accessing it
  • Loading branch information
st3iny authored Jan 27, 2023
2 parents 49a3df3 + f5a6a69 commit 18e0118
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 18e0118

Please sign in to comment.