diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2024-09-10 13:24:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-10 13:24:44 +0200 |
commit | 12ea0eb24ab626cce10060c048c842d5c34f1b8e (patch) | |
tree | 409ef180562c9af81b7c070fad85efed4722e420 /lib | |
parent | 225f7ecdb9bde40e6474dc6917a7f91db961b31f (diff) | |
parent | bcf9f91893c9474e805dd34f0cc1ff4c13e126dc (diff) | |
download | nextcloud-server-12ea0eb24ab626cce10060c048c842d5c34f1b8e.tar.gz nextcloud-server-12ea0eb24ab626cce10060c048c842d5c34f1b8e.zip |
Merge pull request #47858 from nextcloud/fix/preview/handle-no-local-file
fix(preview): gracefully handle file not being opened in ProviderV2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Preview/ProviderV2.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Preview/ProviderV2.php b/lib/private/Preview/ProviderV2.php index ca10aa67b36..7251dd70d17 100644 --- a/lib/private/Preview/ProviderV2.php +++ b/lib/private/Preview/ProviderV2.php @@ -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); |