mirror of
https://github.com/friendica/friendica
synced 2025-04-22 10:30:12 +00:00
Ensures Search methods return an empty ResultList instead of null
- Addresses https://github.com/friendica/friendica/issues/6916#issuecomment-494876901
This commit is contained in:
parent
fc0733d1ec
commit
08d7d42f81
2 changed files with 16 additions and 16 deletions
|
@ -64,7 +64,6 @@ class BaseSearchModule extends BaseModule
|
|||
if ($localSearch && empty($results)) {
|
||||
$pager->setItemsPerPage(80);
|
||||
$results = Search::getContactsFromLocalDirectory($search, $type, $pager->getStart(), $pager->getItemsPerPage());
|
||||
|
||||
} elseif (strlen($config->get('system', 'directory')) && empty($results)) {
|
||||
$results = Search::getContactsFromGlobalDirectory($search, $type, $pager->getPage());
|
||||
$pager->setItemsPerPage($results->getItemsPage());
|
||||
|
@ -86,8 +85,8 @@ class BaseSearchModule extends BaseModule
|
|||
*/
|
||||
protected static function printResult(ResultList $results, Pager $pager, $header = '')
|
||||
{
|
||||
if (empty($results) || empty($results->getResults())) {
|
||||
info(L10n::t('No matches') . EOL);
|
||||
if ($results->getTotal() == 0) {
|
||||
info(L10n::t('No matches'));
|
||||
return '';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue