forked from GNUsocial/gnu-social
Profile->getCurrentNotice handles PrivateStreamException
This commit is contained in:
parent
de7e8c59e8
commit
6a16939830
@ -235,15 +235,21 @@ class Profile extends Managed_DataObject
|
|||||||
*/
|
*/
|
||||||
function getCurrentNotice()
|
function getCurrentNotice()
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
$notice = $this->getNotices(0, 1);
|
$notice = $this->getNotices(0, 1);
|
||||||
|
|
||||||
if ($notice->fetch()) {
|
if ($notice->fetch()) {
|
||||||
if ($notice instanceof ArrayWrapper) {
|
if ($notice instanceof ArrayWrapper) {
|
||||||
// hack for things trying to work with single notices
|
// hack for things trying to work with single notices
|
||||||
|
// ...but this shouldn't happen anymore I think. Keeping it for safety...
|
||||||
return $notice->_items[0];
|
return $notice->_items[0];
|
||||||
}
|
}
|
||||||
return $notice;
|
return $notice;
|
||||||
}
|
}
|
||||||
|
} catch (PrivateStreamException $e) {
|
||||||
|
// Maybe we should let this through if it's handled well upstream
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user