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 6a6584741f
commit 4c09c1dc47

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;