mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(preview): gracefully handle file not being opened in ProviderV2
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
0f732199d2
commit
bcf9f91893
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue