From 7590732794d85d40be404c149aef8305c50a9c02 Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Wed, 22 Jun 2011 15:57:32 -0400 Subject: Ensure the feed has posts before trying to iterate it. --- controllers/UsersController.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'controllers') 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'); } -- cgit v1.2.3