Skip to content

Commit

Permalink
Just because an array key doesn't imply the value at that key isn't n…
Browse files Browse the repository at this point in the history
…ull.

Fixes #2225.

Signed-off-by: JS Moore <[email protected]>
  • Loading branch information
jakkarth committed Jan 24, 2024
1 parent 62fddcf commit 718f93c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Listener/OriginalDateTimeMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function handle(Event $event): void {
$metadata = $event->getMetadata();

// Try to use EXIF data.
if ($metadata->hasKey('photos-exif') && array_key_exists('DateTimeOriginal', $metadata->getArray('photos-exif'))) {
if ($metadata->hasKey('photos-exif') && !empty($metadata->getArray('photos-exif')['DateTimeOriginal'])) {
$rawDateTimeOriginal = $metadata->getArray('photos-exif')['DateTimeOriginal'];
$timestampOriginal = $this->dateToTimestamp("Y:m:d G:i:s", $rawDateTimeOriginal, $node);
if ($timestampOriginal !== false) {
Expand Down

0 comments on commit 718f93c

Please sign in to comment.