From: Evan Prodromou Date: Wed, 21 Sep 2011 21:15:55 +0000 (-0400) Subject: don't cause an error on non-user profile in api X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d214d4533ca7b0cd481189f598e071766689be4b;p=quix0rs-gnu-social.git don't cause an error on non-user profile in api --- 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