summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-01 11:26:08 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-01 11:26:08 +0100
commitc091ac5d195fc224a344320e35b0a6b053cb5178 (patch)
treeca079885376ced20bcde21f827d1951b965e2b00 /apps
parentd1313b361c96bfddeabd94e9fd9b417a776d83d0 (diff)
parentca5d72e6b0fb5d2b50bc20bd8f624a58bf0e4478 (diff)
downloadnextcloud-server-c091ac5d195fc224a344320e35b0a6b053cb5178.tar.gz
nextcloud-server-c091ac5d195fc224a344320e35b0a6b053cb5178.zip
Merge pull request #22021 from owncloud/fix-system-addressbook-sync-with-encryption
Catch potential exceptions when accessing the users avatar - e.g. iss…
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/carddav/converter.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/dav/lib/carddav/converter.php b/apps/dav/lib/carddav/converter.php
index 06d3cb4f18e..c8d9b94c267 100644
--- a/apps/dav/lib/carddav/converter.php
+++ b/apps/dav/lib/carddav/converter.php
@@ -39,7 +39,7 @@ class Converter {
$displayName = empty($displayName ) ? $uid : $displayName;
$emailAddress = $user->getEMailAddress();
$cloudId = $user->getCloudId();
- $image = $user->getAvatarImage(-1);
+ $image = $this->getAvatarImage($user);
$vCard = new VCard();
$vCard->add(new Text($vCard, 'UID', $uid));
@@ -72,7 +72,7 @@ class Converter {
$displayName = empty($displayName ) ? $uid : $displayName;
$emailAddress = $user->getEMailAddress();
$cloudId = $user->getCloudId();
- $image = $user->getAvatarImage(-1);
+ $image = $this->getAvatarImage($user);
$updated = false;
if($this->propertyNeedsUpdate($vCard, 'FN', $displayName)) {
@@ -155,4 +155,17 @@ class Converter {
return $result;
}
+ /**
+ * @param IUser $user
+ * @return null|IImage
+ */
+ private function getAvatarImage(IUser $user) {
+ try {
+ $image = $user->getAvatarImage(-1);
+ return $image;
+ } catch (\Exception $ex) {
+ return null;
+ }
+ }
+
}