aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Steinmetz <richard@steinmetz.cloud>2024-09-10 08:49:43 +0200
committerRichard Steinmetz <richard@steinmetz.cloud>2024-09-10 08:49:43 +0200
commitbcf9f91893c9474e805dd34f0cc1ff4c13e126dc (patch)
tree96b2e88cb5770265ee6334f27abf3afc90444aac /lib
parent0f732199d22cf85d991f48389c33fb6e76b7eefc (diff)
downloadnextcloud-server-bcf9f91893c9474e805dd34f0cc1ff4c13e126dc.tar.gz
nextcloud-server-bcf9f91893c9474e805dd34f0cc1ff4c13e126dc.zip
fix(preview): gracefully handle file not being opened in ProviderV2
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 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);