From dc21869c31ec39fc48e6d045462a09aed568fe40 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 30 Dec 2010 21:34:01 +0000 Subject: put a catch in for a bad owner in the friends widget git-svn-id: http://code.elgg.org/elgg/trunk@7778 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/widgets/friends/content.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'views/default/widgets/friends') diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php index 2f9ab71ea..e0385027d 100644 --- a/views/default/widgets/friends/content.php +++ b/views/default/widgets/friends/content.php @@ -9,8 +9,8 @@ */ -// owner of the profile page -$owner = get_user($vars['entity']->owner_guid); +// owner of the widget +$owner = $vars['entity']->getOwnerEntity(); // the number of friends to display $num = (int) $vars['entity']->num_display; @@ -19,8 +19,9 @@ $num = (int) $vars['entity']->num_display; $size = $vars['entity']->icon_size; // Get the user's friends -$friends = $owner->getFriends("", $num); - +if ($owner) { + $friends = $owner->getFriends("", $num); +} // If there are any friends to view, view them if (is_array($friends) && sizeof($friends) > 0) { -- cgit v1.2.3