Properly handle null as ownerId if file system access is denied by access token

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-02-24 11:08:04 +01:00
parent 6ee7286b41
commit c778032276
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 6 additions and 2 deletions

View File

@ -1381,8 +1381,12 @@ class View {
if ($mount instanceof MoveableMount && $internalPath === '') {
$data['permissions'] |= \OCP\Constants::PERMISSION_DELETE;
}
$owner = $this->getUserObjectForOwner($storage->getOwner($internalPath));
$ownerId = $storage->getOwner($internalPath);
$owner = null;
if ($ownerId !== null) {
// ownerId might be null if files are accessed with an access token without file system access
$owner = $this->getUserObjectForOwner($ownerId);
}
$info = new FileInfo($path, $storage, $internalPath, $data, $mount, $owner);
if ($data and isset($data['fileid'])) {