fix(preview): gracefully handle file not being opened in ProviderV2

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
Richard Steinmetz 2024-09-10 08:49:43 +02:00
parent 0f732199d2
commit bcf9f91893
No known key found for this signature in database
GPG key ID: 27137D9E7D273FB2

View file

@ -71,6 +71,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);