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 committed by backportbot[bot]
parent 819bd7372d
commit b738eaa0c9

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);