Browse Source

Exit early if $storage is falsy in View::getDirectoryContent

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/31754/head
Côme Chilliet 4 years ago
committed by Côme Chilliet (Rebase PR Action)
parent
commit
d36a1a7bf6
  1. 12
      lib/private/Files/View.php

12
lib/private/Files/View.php

@ -1436,15 +1436,16 @@ class View {
if (!Filesystem::isValidPath($directory)) { if (!Filesystem::isValidPath($directory)) {
return []; return [];
} }
$path = $this->getAbsolutePath($directory); $path = $this->getAbsolutePath($directory);
$path = Filesystem::normalizePath($path); $path = Filesystem::normalizePath($path);
$mount = $this->getMount($directory); $mount = $this->getMount($directory);
if (!$mount) {
return [];
}
$storage = $mount->getStorage(); $storage = $mount->getStorage();
$internalPath = $mount->getInternalPath($path); $internalPath = $mount->getInternalPath($path);
if ($storage) {
if (!$storage) {
return [];
}
$cache = $storage->getCache($internalPath); $cache = $storage->getCache($internalPath);
$user = \OC_User::getUser(); $user = \OC_User::getUser();
@ -1551,9 +1552,6 @@ class View {
} }
return array_values($files); return array_values($files);
} else {
return [];
}
} }
/** /**

Loading…
Cancel
Save