aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2024-02-23 16:07:43 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-02-26 07:42:12 +0000
commit44524b138870fbf633897ff79cb508bfd16c62f1 (patch)
tree00a42037261564208213b7e9156dd23086584d5e /lib
parent3f04d6aa0077f01cbeabc5586c0b38754d4cdbe3 (diff)
downloadnextcloud-server-44524b138870fbf633897ff79cb508bfd16c62f1.tar.gz
nextcloud-server-44524b138870fbf633897ff79cb508bfd16c62f1.zip
fix: Throw instead of yielding nothing when listing local directories
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Common.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 3d5a2f098b2..fe88fb3150f 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -61,6 +61,7 @@ use OCP\Files\ReservedWordException;
use OCP\Files\Storage\ILockingStorage;
use OCP\Files\Storage\IStorage;
use OCP\Files\Storage\IWriteStreamStorage;
+use OCP\Files\StorageNotAvailableException;
use OCP\Lock\ILockingProvider;
use OCP\Lock\LockedException;
use Psr\Log\LoggerInterface;
@@ -894,6 +895,11 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
public function getDirectoryContent($directory): \Traversable {
$dh = $this->opendir($directory);
+
+ if ($dh === false) {
+ throw new StorageNotAvailableException('Directory listing failed');
+ }
+
if (is_resource($dh)) {
$basePath = rtrim($directory, '/');
while (($file = readdir($dh)) !== false) {