diff options
author | Claus-Justus Heine <himself@claus-justus-heine.de> | 2022-02-03 08:56:24 +0100 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-04-17 16:19:02 +0200 |
commit | b3d836332720f8e1be7d9392fa76a20733ff5a10 (patch) | |
tree | cb71d8c6d759fa27fc6659ed0e7f43bc38a53a09 /lib/private | |
parent | e63720b7140d15cd4c0b080c57c226d9a2dda8a6 (diff) | |
download | nextcloud-server-b3d836332720f8e1be7d9392fa76a20733ff5a10.tar.gz nextcloud-server-b3d836332720f8e1be7d9392fa76a20733ff5a10.zip |
Prevent the OpenDocument preview generator from trying to open empty files.
Rationale: does not make sense, and triggers a deprecation error in
\ZipArchive.
Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Preview/Bundled.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Preview/Bundled.php b/lib/private/Preview/Bundled.php index df7f630dff7..812385c1672 100644 --- a/lib/private/Preview/Bundled.php +++ b/lib/private/Preview/Bundled.php @@ -31,6 +31,11 @@ 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; |