Workaround for bug causing fatal error during favoriting; Profile::getCurrentNotice() was returning an ArrayList instead of a Notice directly due to pulling through Profile::getNotices(). This caused failure in Fave::addNew() which specifies it wants a Notice. Caused failure of the 'fav' IM command.

This commit is contained in:
Brion Vibber 2011-03-01 17:01:35 -08:00
parent 8cacecb6dc
commit d09aa9c947
1 changed files with 4 additions and 0 deletions

View File

@ -186,6 +186,10 @@ class Profile extends Memcached_DataObject
$notice = $this->getNotices(0, 1);
if ($notice->fetch()) {
if ($notice instanceof ArrayWrapper) {
// hack for things trying to work with single notices
return $notice->_items[0];
}
return $notice;
} else {
return null;