- if (!empty($cur)) {
- $curProfile = $cur->getProfile();
- } else {
- $curProfile = null;
- }
-
- if (!$this->notice->inScope($curProfile)) {
- // TRANS: Client exception thrown when referring to a bookmark the user has no access to.
- throw new ClientException(_m('Not available.'), 403);
- }
-
- $this->user = User::staticGet('id', $this->bookmark->profile_id);
-
- if (empty($this->user)) {
- // TRANS: Client exception thrown when referring to a bookmark for a non-existing user.
- throw new ClientException(_m('No such user.'), 404);
- }
-
- $this->profile = $this->user->getProfile();
-
- if (empty($this->profile)) {
- // TRANS: Client exception thrown when referring to a bookmark for a non-existing profile.
- throw new ServerException(_m('User without a profile.'));
- }
-
- $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
-
- return true;