removes error in blocked-feed when we haven't blocked anyone
This commit is contained in:
parent
4be6c25996
commit
0f9ec45a06
|
@ -109,14 +109,18 @@ class ApiQvitterBlocksAction extends ApiPrivateAuthAction
|
|||
|
||||
$blocks = QvitterBlocked::getBlocked($this->target->id, $offset, $limit);
|
||||
|
||||
if($blocks) {
|
||||
$profiles = array();
|
||||
|
||||
while ($blocks->fetch()) {
|
||||
$this_profile_block = clone($blocks);
|
||||
$profiles[] = $this->getTargetProfile($this_profile_block->blocked);
|
||||
}
|
||||
|
||||
return $profiles;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,7 +49,12 @@ class QvitterBlocked extends Profile_block
|
|||
public static function getBlocked($profile_id, $offset = 0, $limit = PROFILES_PER_PAGE)
|
||||
{
|
||||
$ids = self::getBlockedIDs($profile_id, $offset, $limit);
|
||||
return Profile_block::listFind('blocked', $ids);
|
||||
try {
|
||||
$blocked = Profile_block::listFind('blocked', $ids);
|
||||
return $blocked;
|
||||
} catch(NoResultException $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user