From 8fa816c32450c9bbe1a9c306835ad97e3eca5be6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 22 Sep 2011 16:29:31 -0400 Subject: [PATCH] don't use potentially bad Profile values --- classes/Profile.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/classes/Profile.php b/classes/Profile.php index f61803dcd0..7f45031f66 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -1420,14 +1420,18 @@ class Profile extends Managed_DataObject { $ids = array(); foreach ($profiles as $profile) { - $ids[] = $profile->id; + if (!empty($profile)) { + $ids[] = $profile->id; + } } $avatars = Avatar::pivotGet('profile_id', $ids, array('width' => $width, 'height' => $width)); foreach ($profiles as $profile) { - $profile->_fillAvatar($width, $avatars[$profile->id]); + if (!empty($profile)) { // ??? + $profile->_fillAvatar($width, $avatars[$profile->id]); + } } } -- 2.39.5