diff options
author | Simon L <szaimen@e.mail.de> | 2023-04-18 12:18:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 12:18:14 +0200 |
commit | 8508865eaf9e4caad76be9261bb5be10aa4a326a (patch) | |
tree | 6bfc098c894f9b81cb39cb29c7ac97a1fe34bd15 | |
parent | 1861aa56eaa0175f96c33cc5bf0a3e6c24a969a4 (diff) | |
parent | 800f40b71c65a11034eb4b5d28c7b83fb8687357 (diff) | |
download | nextcloud-server-8508865eaf9e4caad76be9261bb5be10aa4a326a.tar.gz nextcloud-server-8508865eaf9e4caad76be9261bb5be10aa4a326a.zip |
Merge pull request #37772 from nextcloud/enh/30986/follow-up
Prevent the OpenDocument preview generator from trying to open empty files
-rw-r--r-- | lib/private/Preview/Bundled.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Preview/Bundled.php b/lib/private/Preview/Bundled.php index df7f630dff7..2a408b90c4e 100644 --- a/lib/private/Preview/Bundled.php +++ b/lib/private/Preview/Bundled.php @@ -31,6 +31,10 @@ use OCP\IImage; */ abstract class Bundled extends ProviderV2 { protected function extractThumbnail(File $file, string $path): ?IImage { + if ($file->getSize() === 0) { + return null; + } + $sourceTmp = \OC::$server->getTempManager()->getTemporaryFile(); $targetTmp = \OC::$server->getTempManager()->getTemporaryFile(); $this->tmpFiles[] = $sourceTmp; |