summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-02-29 11:26:23 +0100
committerGitHub <noreply@github.com>2024-02-29 11:26:23 +0100
commit9b326c0c6df0ef8c11979f87411b6bf48bceb2ea (patch)
treea13d19381862048d9ceb0a56472d172889e18418 /lib
parentde66363230c20c06fc39f81aaf7b71ac8311ccd6 (diff)
parentd718a2adb1c8c837c467fd2b707f2e7384df28be (diff)
downloadnextcloud-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.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 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) {