Merge pull request #29420 from nextcloud/backport/29400/stable21

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

View file

@ -140,7 +140,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;
}