]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
put a catch in for a bad owner in the friends widget
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 30 Dec 2010 21:34:01 +0000 (21:34 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 30 Dec 2010 21:34:01 +0000 (21:34 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7778 36083f99-b078-4883-b0ff-0f9b5a30f544

views/default/widgets/friends/content.php

index 2f9ab71eaeb9e4b5efc0a633bef7451ab1ecd247..e0385027db062c6a45e1026e6340e356cef44ae0 100644 (file)
@@ -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) {