- $user = $this->user;
- $profile = $user->getProfile();
- if (!$profile) {
- common_log_db_error($user, 'SELECT', __FILE__);
- // TRANS: Error message displayed when referring to a user without a profile.
- $this->serverError(_('User has no profile.'));
- return null;
- }
- $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
- return ($avatar) ? $avatar->url : null;