- if (!$this->user) {
- // TRANS: Client error displayed when calling a profile action without specifying a user.
- $this->clientError(_('No such user.'), 404);
- return false;
- }
+ $this->target = $this->user->getProfile();
+ } catch (NicknameException $e) {
+ $id = (int)$this->arg('id');
+ $this->target = Profile::getKV('id', $id);
+
+ if (!$this->target instanceof Profile) {
+ // TRANS: Error message displayed when referring to a user without a profile.
+ $this->serverError(_m('Profile ID does not exist.'));
+ }