Skip to content

Commit

Permalink
Fix unhandled exception in occ search command
Browse files Browse the repository at this point in the history
Fix for  unhandled exception, when SearchService is being used by
occ fulltextsearch:search command.
We ensure, that userId member of SearchService is set properly.

This commit fixes issue nextcloud#72

Signed-off-by: Maciek Barczak <[email protected]>
  • Loading branch information
Maciek Barczak committed Jan 18, 2021
1 parent 966334f commit 269a5e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Service/SearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public function improveSearchRequest(ISearchRequest $request) {
$this->searchQueryInOptions($request);
$this->searchQueryFiltersExtension($request);
$this->searchQueryFiltersSource($request);

if($this->userId === null) {
$this->userId = $this->miscService->secureUsername($request->getAuthor());
}
$request->addPart('comments');
$this->extensionService->searchRequest($request);
}
Expand Down

0 comments on commit 269a5e4

Please sign in to comment.