Skip to content

Commit

Permalink
fix(preview): gracefully handle file not being opened in ProviderV2
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny authored and backportbot[bot] committed Sep 10, 2024
1 parent 3c2ead7 commit 704310d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/private/Preview/ProviderV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ protected function getLocalFile(File $file, int $maxSize = null) {
$absPath = \OC::$server->getTempManager()->getTemporaryFile();

$content = $file->fopen('r');
if ($content === false) {
return false;
}

if ($maxSize) {
$content = stream_get_contents($content, $maxSize);
Expand Down

0 comments on commit 704310d

Please sign in to comment.