Merge pull request #37772 from nextcloud/enh/30986/follow-up

Prevent the OpenDocument preview generator from trying to open empty files
pull/37791/head
Simon L 2023-04-18 12:18:14 +07:00 committed by GitHub
commit 8508865eaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

@ -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;