Skip to content

Commit 6176f06

Browse files
committed
fix(metdata): Correctly handle FilesMetadataNotFoundException on blurhash generation
Signed-off-by: Marcel Müller <[email protected]>
1 parent 6101abb commit 6176f06

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/private/Blurhash/Listener/GenerateBlurhashMetadata.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use OCP\Files\NotFoundException;
3636
use OCP\Files\NotPermittedException;
3737
use OCP\FilesMetadata\AMetadataEvent;
38+
use OCP\FilesMetadata\Exceptions\FilesMetadataNotFoundException;
3839
use OCP\FilesMetadata\Event\MetadataBackgroundEvent;
3940
use OCP\FilesMetadata\Event\MetadataLiveEvent;
4041
use OCP\IPreview;
@@ -74,8 +75,12 @@ public function handle(Event $event): void {
7475

7576
$currentEtag = $file->getEtag();
7677
$metadata = $event->getMetadata();
77-
if ($metadata->getEtag('blurhash') === $currentEtag) {
78-
return;
78+
79+
try {
80+
if ($metadata->getEtag('blurhash') === $currentEtag) {
81+
return;
82+
}
83+
} catch (FilesMetadataNotFoundException) {
7984
}
8085

8186
// too heavy to run on the live thread, request a rerun as a background job

0 commit comments

Comments
 (0)