Merge pull request #47867 from nextcloud/backport/47858/stable29

[stable29] fix(preview): gracefully handle file not being opened in ProviderV2
This commit is contained in:
John Molakvoæ 2024-09-15 22:55:11 +02:00 committed by GitHub
commit e60dd69fda
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,6 +88,9 @@ abstract class ProviderV2 implements IProviderV2 {
$absPath = \OC::$server->getTempManager()->getTemporaryFile();
$content = $file->fopen('r');
if ($content === false) {
return false;
}
if ($maxSize) {
$content = stream_get_contents($content, $maxSize);