From 51b42ef3460e16a679f57c2e82a1bc1451ba32e3 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Tue, 10 Sep 2024 08:49:43 +0200 Subject: fix(preview): gracefully handle file not being opened in ProviderV2 Signed-off-by: Richard Steinmetz --- lib/private/Preview/ProviderV2.php | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v1.2.3