$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));
$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)) {
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;
+ }
+ }
+
}