Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/Controller/UnifiedSearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
namespace OC\Core\Controller;

use InvalidArgumentException;
use OC\Search\SearchComposer;
use OC\Search\SearchQuery;
use OCA\Core\ResponseDefinitions;
Expand Down Expand Up @@ -111,7 +112,7 @@ public function search(

try {
$filters = $this->composer->buildFilterList($providerId, $this->request->getParams());
} catch (UnsupportedFilter $e) {
} catch (UnsupportedFilter|InvalidArgumentException $e) {
return new DataResponse($e->getMessage(), Http::STATUS_BAD_REQUEST);
}
return new DataResponse(
Expand Down
5 changes: 3 additions & 2 deletions lib/private/Search/Filter/GroupFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ public function __construct(
string $value,
IGroupManager $groupManager,
) {
$this->group = $groupManager->get($value);
if ($this->group === null) {
$group = $groupManager->get($value);
if ($group === null) {
throw new InvalidArgumentException('Group '.$value.' not found');
}
$this->group = $group;
}

public function get(): IGroup {
Expand Down
5 changes: 3 additions & 2 deletions lib/private/Search/Filter/UserFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ public function __construct(
string $value,
IUserManager $userManager,
) {
$this->user = $userManager->get($value);
if ($this->user === null) {
$user = $userManager->get($value);
if ($user === null) {
throw new InvalidArgumentException('User '.$value.' not found');
}
$this->user = $user;
}

public function get(): IUser {
Expand Down