diff options
author | Michael Francis <edude03@gmail.com> | 2011-06-22 15:57:32 -0400 |
---|---|---|
committer | Michael Francis <edude03@gmail.com> | 2011-06-22 15:57:32 -0400 |
commit | 7590732794d85d40be404c149aef8305c50a9c02 (patch) | |
tree | c1841c3aa4d9b70a60a1bbd7f6097833e8863030 /controllers | |
parent | 0a2da261e93f3887812c494b64bed5154bdfebab (diff) | |
download | otakuhub-7590732794d85d40be404c149aef8305c50a9c02.tar.xz |
Ensure the feed has posts before trying to iterate it.
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/UsersController.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/controllers/UsersController.php b/controllers/UsersController.php index 5462d25..cc0b3db 100644 --- a/controllers/UsersController.php +++ b/controllers/UsersController.php @@ -194,6 +194,7 @@ class UsersController extends \lithium\action\Controller { //Set the feed variable scope (since we are going to use it outside the loop) $feed; + if (isset($user->feed)) { //For each post ID in $users feed, foreach ($user->feed as $post) { @@ -216,6 +217,7 @@ class UsersController extends \lithium\action\Controller { $feed = array_reverse($feed); //This renders a custom layout we use for the feed, then passes user and feed to the view for the variables. + } return compact('user', 'feed'); } |