Skip to content

Commit e60dd69

Browse files
authored
Merge pull request #47867 from nextcloud/backport/47858/stable29
[stable29] fix(preview): gracefully handle file not being opened in ProviderV2
2 parents 95c3012 + 51b42ef commit e60dd69

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/private/Preview/ProviderV2.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ protected function getLocalFile(File $file, ?int $maxSize = null) {
8888
$absPath = \OC::$server->getTempManager()->getTemporaryFile();
8989

9090
$content = $file->fopen('r');
91+
if ($content === false) {
92+
return false;
93+
}
9194

9295
if ($maxSize) {
9396
$content = stream_get_contents($content, $maxSize);

0 commit comments

Comments
 (0)