aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2024-09-10 08:49:43 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-09-10 11:26:38 +0000
commit51b42ef3460e16a679f57c2e82a1bc1451ba32e3 (patch)
tree60b293095a74e50525a70b532f6be0353f4f75b3 /lib
parentb359a650e5e0507685702b6d56c2e8debb0abda6 (diff)
downloadnextcloud-server-51b42ef3460e16a679f57c2e82a1bc1451ba32e3.tar.gz
nextcloud-server-51b42ef3460e16a679f57c2e82a1bc1451ba32e3.zip
fix(preview): gracefully handle file not being opened in ProviderV2backport/47858/stable29
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
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 6d80594d1c8..7a5dfabc59c 100644
--- a/lib/private/Preview/ProviderV2.php
+++ b/lib/private/Preview/ProviderV2.php
@@ -88,6 +88,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);