Skip to content

Commit 91021b6

Browse files
authored
Small fix to remove a warning during the indexing of entities with no created_at attribute (#1586)
1 parent 48ce0d7 commit 91021b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Helper/AlgoliaHelper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,9 @@ protected function prepareRecords(array &$objects, string $indexName): void
593593
foreach ($objects as $key => &$object) {
594594
$object['algoliaLastUpdateAtCET'] = $currentCET;
595595
// Convert created_at to UTC timestamp
596-
$object['created_at'] = strtotime($object['created_at']);
596+
if (isset($object['created_at'])) {
597+
$object['created_at'] = strtotime($object['created_at']);
598+
}
597599

598600
$previousObject = $object;
599601

0 commit comments

Comments
 (0)