Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(preview): gracefully handle file not being opened in ProviderV2
Signed-off-by: Richard Steinmetz <[email protected]>
  • Loading branch information
st3iny authored and backportbot[bot] committed Sep 10, 2024
commit 704310d3fae420694775c15748ccb02dd9954c44
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