Skip to content

Commit 9b326c0

Browse files
authored
Merge pull request #43830 from nextcloud/backport/43787/stable27
2 parents de66363 + d718a2a commit 9b326c0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/private/Files/Storage/Common.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
use OCP\Files\Storage\ILockingStorage;
6262
use OCP\Files\Storage\IStorage;
6363
use OCP\Files\Storage\IWriteStreamStorage;
64+
use OCP\Files\StorageNotAvailableException;
6465
use OCP\Lock\ILockingProvider;
6566
use OCP\Lock\LockedException;
6667
use Psr\Log\LoggerInterface;
@@ -894,6 +895,11 @@ public function writeStream(string $path, $stream, int $size = null): int {
894895

895896
public function getDirectoryContent($directory): \Traversable {
896897
$dh = $this->opendir($directory);
898+
899+
if ($dh === false) {
900+
throw new StorageNotAvailableException('Directory listing failed');
901+
}
902+
897903
if (is_resource($dh)) {
898904
$basePath = rtrim($directory, '/');
899905
while (($file = readdir($dh)) !== false) {

0 commit comments

Comments
 (0)