diff options
author | Julius Härtl <jus@bitgrid.net> | 2024-02-23 16:07:43 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2024-02-23 16:08:09 +0100 |
commit | 22eab7ba366cc7d0f4debbc957105ac00bbcd8ba (patch) | |
tree | fe8c8ca28ac799fa1be7a168198cc64e865f56f0 /lib/private/Files | |
parent | 3814ef6d06ebb12e5765d37719597aa14646156a (diff) | |
download | nextcloud-server-22eab7ba366cc7d0f4debbc957105ac00bbcd8ba.tar.gz nextcloud-server-22eab7ba366cc7d0f4debbc957105ac00bbcd8ba.zip |
fix: Throw instead of yielding nothing when listing local directories
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Storage/Common.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 65c2580e61c..830f0aaded7 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -62,6 +62,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 OCP\Server; @@ -898,6 +899,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) { |