Merge pull request #29419 from nextcloud/backport/29400/stable22

[stable22] fixes an undefined index when getAccessList returns an empty array
This commit is contained in:
blizzz 2021-10-24 01:25:57 +02:00 committed by GitHub
commit 7fe15c719c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,7 +141,7 @@ class File implements IEntity, IDisplayText, IUrl, IIcon, IContextPortation {
return true;
}
$acl = $this->shareManager->getAccessList($node, true, true);
return array_key_exists($uid, $acl['users']);
return isset($acl['users']) && array_key_exists($uid, $acl['users']);
} catch (NotFoundException $e) {
return false;
}