diff options
Diffstat (limited to 'apps/dav/lib/carddav/converter.php')
-rw-r--r-- | apps/dav/lib/carddav/converter.php | 17 |
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; + } + } + } |