summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-02-29 11:32:48 +0100
committerGitHub <noreply@github.com>2024-02-29 11:32:48 +0100
commitad6f72d0d18181bd03fbf8e7269fa28160ab5c6e (patch)
treeb5f0121dce32c33a70e3a7a6b6b848b06e05ca5b /lib/private
parentf48e478791f1b1ef8f6bf0bac6d07a60f222ed39 (diff)
parent44524b138870fbf633897ff79cb508bfd16c62f1 (diff)
downloadnextcloud-server-ad6f72d0d18181bd03fbf8e7269fa28160ab5c6e.tar.gz
nextcloud-server-ad6f72d0d18181bd03fbf8e7269fa28160ab5c6e.zip
Merge pull request #43828 from nextcloud/backport/43787/stable28
Diffstat (limited to 'lib/private')
-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) {