Skip to content

Commit 3795d7e

Browse files
authored
Merge pull request #43857 from nextcloud/backport/43787/stable23
2 parents f1bf73b + b65c8c2 commit 3795d7e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/private/Files/Storage/Common.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
use OCP\Files\Storage\ILockingStorage;
6161
use OCP\Files\Storage\IStorage;
6262
use OCP\Files\Storage\IWriteStreamStorage;
63+
use OCP\Files\StorageNotAvailableException;
6364
use OCP\ILogger;
6465
use OCP\Lock\ILockingProvider;
6566
use OCP\Lock\LockedException;
@@ -877,6 +878,11 @@ public function writeStream(string $path, $stream, int $size = null): int {
877878

878879
public function getDirectoryContent($directory): \Traversable {
879880
$dh = $this->opendir($directory);
881+
882+
if ($dh === false) {
883+
throw new StorageNotAvailableException('Directory listing failed');
884+
}
885+
880886
if (is_resource($dh)) {
881887
$basePath = rtrim($directory, '/');
882888
while (($file = readdir($dh)) !== false) {

0 commit comments

Comments
 (0)