Skip to content

Commit

Permalink
Merge pull request #43787 from nextcloud/fix/opendir-temporary-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv committed Feb 24, 2024
2 parents d6df5b5 + 22eab7b commit 1d8d43f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
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 OCP\Server;
Expand Down Expand Up @@ -898,6 +899,11 @@ public function writeStream(string $path, $stream, int $size = null): int {

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) {
Expand Down

0 comments on commit 1d8d43f

Please sign in to comment.