From 54a68a40469fb836a36388cabd6c8c368a7846d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 4 Dec 2023 08:42:20 +0100 Subject: [PATCH] fix: Skip empty files in metadata providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Listener/ExifMetadataProvider.php | 2 +- lib/Listener/SizeMetadataProvider.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Listener/ExifMetadataProvider.php b/lib/Listener/ExifMetadataProvider.php index 1d82861c1..1fcb348f9 100644 --- a/lib/Listener/ExifMetadataProvider.php +++ b/lib/Listener/ExifMetadataProvider.php @@ -48,7 +48,7 @@ public function handle(Event $event): void { $node = $event->getNode(); - if (!$node instanceof File) { + if (!$node instanceof File || $node->getSize() === 0) { return; } diff --git a/lib/Listener/SizeMetadataProvider.php b/lib/Listener/SizeMetadataProvider.php index fce1663c0..0a78b598a 100644 --- a/lib/Listener/SizeMetadataProvider.php +++ b/lib/Listener/SizeMetadataProvider.php @@ -45,7 +45,7 @@ public function handle(Event $event): void { $node = $event->getNode(); - if (!$node instanceof File) { + if (!$node instanceof File || $node->getSize() === 0) { return; }