function handle($args) {
parent::handle($args);
- $nickname = $this->arg('nickname');
- $profile = Profile::staticGet('nickname', $nickname);
- if (!$profile) {
+ $nickname = common_canonical_nickname($this->arg('nickname'));
+
+ $user = User::staticGet('nickname', $nickname);
+
+ if (!$user) {
$this->no_such_user();
return;
}
- $user = User::staticGet($profile->id);
- if (!$user) {
- $this->no_such_user();
+
+ $profile = $user->getProfile();
+
+ if (!$profile) {
+ $this->server_error(_('User without matching profile in system.'));
return;
}
+
$page = $this->arg('page');
if (!$page) {
$page = 1;
break;
}
- $other = Profile::staticGet($this->get_other($subs));
+ $other_id = $this->get_other($subs);
+ $other = Profile::staticGet($other_id);
+
+ if (!$other) {
+ common_log(LOG_WARNING, 'No matching profile for ' . $other_id);
+ continue;
+ }
common_element_start('li');