don't use potentially bad Profile values

This commit is contained in:
Evan Prodromou 2011-09-22 16:29:31 -04:00
parent f65fa42e15
commit 8fa816c324

View File

@ -1420,16 +1420,20 @@ class Profile extends Managed_DataObject
{ {
$ids = array(); $ids = array();
foreach ($profiles as $profile) { foreach ($profiles as $profile) {
if (!empty($profile)) {
$ids[] = $profile->id; $ids[] = $profile->id;
} }
}
$avatars = Avatar::pivotGet('profile_id', $ids, array('width' => $width, $avatars = Avatar::pivotGet('profile_id', $ids, array('width' => $width,
'height' => $width)); 'height' => $width));
foreach ($profiles as $profile) { foreach ($profiles as $profile) {
if (!empty($profile)) { // ???
$profile->_fillAvatar($width, $avatars[$profile->id]); $profile->_fillAvatar($width, $avatars[$profile->id]);
} }
} }
}
// Can't seem to find how to fix this. // Can't seem to find how to fix this.