]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't cause an error on non-user profile in api
authorEvan Prodromou <evan@status.net>
Wed, 21 Sep 2011 21:15:55 +0000 (17:15 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 21 Sep 2011 21:15:55 +0000 (17:15 -0400)
lib/apiaction.php

index 980500abcc52e1f8b09605829d09286b76860e58..420dd2a7cfbe86b1d7639fff3f1433ead79c7c4e 100644 (file)
@@ -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