diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-02-29 11:26:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-29 11:26:23 +0100 |
commit | 9b326c0c6df0ef8c11979f87411b6bf48bceb2ea (patch) | |
tree | a13d19381862048d9ceb0a56472d172889e18418 /lib | |
parent | de66363230c20c06fc39f81aaf7b71ac8311ccd6 (diff) | |
parent | d718a2adb1c8c837c467fd2b707f2e7384df28be (diff) | |
download | nextcloud-server-9b326c0c6df0ef8c11979f87411b6bf48bceb2ea.tar.gz nextcloud-server-9b326c0c6df0ef8c11979f87411b6bf48bceb2ea.zip |
Merge pull request #43830 from nextcloud/backport/43787/stable27
Diffstat (limited to 'lib')
-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 cd9a05a2a1d..0f48db0650c 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) { |