diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-24 13:08:04 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-03-01 22:57:01 +0300 |
commit | c778032276808efdcc4dbdac94017419aaba57a0 (patch) | |
tree | 4c4eb3f4ce643068d7dd85a94a8e909e3b2fa732 | |
parent | 6ee7286b419f77ae127257bbbf6a57415678076c (diff) |
Properly handle null as ownerId if file system access is denied by access token
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | lib/private/Files/View.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index f12e4609e08..10fbf00e73c 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -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'])) { |