From d214d4533ca7b0cd481189f598e071766689be4b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 21 Sep 2011 17:15:55 -0400 Subject: [PATCH] don't cause an error on non-user profile in api --- lib/apiaction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index 980500abcc..420dd2a7cf 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -215,7 +215,7 @@ class ApiAction extends Action Avatar::defaultImage(AVATAR_STREAM_SIZE); $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(); // Note: some profiles don't have an associated user