if ($email) {
$user = User::staticGet('email', $email);
} else {
- $user = $this->get_user($apidata['api_arg']);
+ $user = $this->get_user($apidata['api_arg'], $apidata);
}
if (empty($user)) {
return;
}
+ $profile = $user->getProfile();
+
+ if (!$profile) {
+ common_server_error(_('User has no profile.'));
+ return;
+ }
+
$twitter_user = $this->twitter_user_array($user->getProfile(), true);
if ($apidata['content-type'] == 'xml') {