don't cause an error on non-user profile in api

This commit is contained in:
Evan Prodromou 2011-09-21 17:15:55 -04:00
parent 642901f4ae
commit d214d4533c

View File

@ -215,7 +215,7 @@ class ApiAction extends Action
Avatar::defaultImage(AVATAR_STREAM_SIZE); Avatar::defaultImage(AVATAR_STREAM_SIZE);
$twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null;
$twitter_user['protected'] = ($user->private_stream) ? true : false; $twitter_user['protected'] = (!empty($user) && $user->private_stream) ? true : false;
$twitter_user['followers_count'] = $profile->subscriberCount(); $twitter_user['followers_count'] = $profile->subscriberCount();
// Note: some profiles don't have an associated user // Note: some profiles don't have an associated user