mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
fix: log fopen calls when stream isn't available
Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
parent
ec4ae84f96
commit
70a6eeed3e
1 changed files with 7 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ use OCP\Files\NotFoundException;
|
|||
use OCP\Files\NotPermittedException;
|
||||
use OCP\IRequest;
|
||||
use ownCloud\TarStreamer\TarStreamer;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use ZipStreamer\ZipStreamer;
|
||||
|
||||
class Streamer {
|
||||
|
|
@ -122,10 +123,16 @@ class Streamer {
|
|||
$dirNode = $userFolder->get($dir);
|
||||
$files = $dirNode->getDirectoryListing();
|
||||
|
||||
/** @var LoggerInterface $logger */
|
||||
$logger = \OC::$server->query(LoggerInterface::class);
|
||||
foreach ($files as $file) {
|
||||
if ($file instanceof File) {
|
||||
try {
|
||||
$fh = $file->fopen('r');
|
||||
if ($fh === false) {
|
||||
$logger->error('Unable to open file for stream: ' . print_r($file, true));
|
||||
continue;
|
||||
}
|
||||
} catch (NotPermittedException $e) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue