aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2024-09-10 13:24:44 +0200
committerGitHub <noreply@github.com>2024-09-10 13:24:44 +0200
commit12ea0eb24ab626cce10060c048c842d5c34f1b8e (patch)
tree409ef180562c9af81b7c070fad85efed4722e420 /lib
parent225f7ecdb9bde40e6474dc6917a7f91db961b31f (diff)
parentbcf9f91893c9474e805dd34f0cc1ff4c13e126dc (diff)
downloadnextcloud-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.php3
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);