diff options
author | Marcel Müller <marcel-mueller@gmx.de> | 2024-03-19 10:49:45 +0100 |
---|---|---|
committer | Marcel Müller <marcel-mueller@gmx.de> | 2024-03-19 11:07:23 +0100 |
commit | a9399ac85cbf2c361e6d1350d0f30c15277a2d9e (patch) | |
tree | 054fc10d12388e63220d4a65cc8dee3529559688 | |
parent | 6101abbb2dd9408cdda666ec491751447dc1ab07 (diff) | |
download | nextcloud-server-fix/44288/catch-filesmetadatanotfound-exception.tar.gz nextcloud-server-fix/44288/catch-filesmetadatanotfound-exception.zip |
fix(metdata): Correctly handle FilesMetadataNotFoundException on blurhash generationfix/44288/catch-filesmetadatanotfound-exception
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
-rw-r--r-- | lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php index b57dfa317e4..ef74a5c81bd 100644 --- a/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php +++ b/lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php @@ -37,6 +37,7 @@ use OCP\Files\NotPermittedException; use OCP\FilesMetadata\AMetadataEvent; use OCP\FilesMetadata\Event\MetadataBackgroundEvent; use OCP\FilesMetadata\Event\MetadataLiveEvent; +use OCP\FilesMetadata\Exceptions\FilesMetadataNotFoundException; use OCP\IPreview; use OCP\Lock\LockedException; @@ -74,8 +75,12 @@ class GenerateBlurhashMetadata implements IEventListener { $currentEtag = $file->getEtag(); $metadata = $event->getMetadata(); - if ($metadata->getEtag('blurhash') === $currentEtag) { - return; + + try { + if ($metadata->getEtag('blurhash') === $currentEtag) { + return; + } + } catch (FilesMetadataNotFoundException) { } // too heavy to run on the live thread, request a rerun as a background job |