]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly handle null as ownerId if file system access is denied by access token
authorJulius Härtl <jus@bitgrid.net>
Sun, 24 Feb 2019 10:08:04 +0000 (11:08 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 1 Mar 2019 19:57:01 +0000 (20:57 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Files/View.php

index f12e4609e082bf341ef0302758b612c3bda2dc19..10fbf00e73c6f5d689beb20b719c63be0540ef7d 100644 (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'])) {