Skip to content

Commit 7d5a420

Browse files
authored
Merge pull request #7705 from nextcloud/fix/noid/user-may-not-be-found
fix: user may be null
2 parents 193b4a5 + fbfb88a commit 7d5a420

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/Db/BoardMapper.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ public function findBoardIds(string $userId): array {
105105
));
106106

107107
// Shared to user groups of the user
108-
$groupIds = $this->groupManager->getUserGroupIds($this->userManager->get($userId));
109-
if (count($groupIds) !== 0) {
108+
$user = $this->userManager->get($userId);
109+
$groupIds = null;
110+
if ($user !== null) {
111+
$groupIds = $this->groupManager->getUserGroupIds($user);
112+
}
113+
if ($groupIds !== null && count($groupIds) !== 0) {
110114
$qb->orWhere($qb->expr()->andX(
111115
$qb->expr()->eq('acl.type', $qb->createNamedParameter(Acl::PERMISSION_TYPE_GROUP, IQueryBuilder::PARAM_INT)),
112116
$qb->expr()->in('acl.participant', $qb->createNamedParameter($groupIds, IQueryBuilder::PARAM_STR_ARRAY)),

0 commit comments

Comments
 (0)