Skip to content

Commit 8e7f8ac

Browse files
authored
fix: cannot call getObject on indexer
1 parent afbd23c commit 8e7f8ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Service/AlgoliaIndexer.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,21 @@ public function getObject($item)
401401
{
402402
$indexes = $this->getService()->initIndexes($item);
403403

404+
if (!$item->AlgoliaUUID) {
405+
return [];
406+
}
407+
404408
foreach ($indexes as $index) {
405409
try {
406-
$output = $index->getObject($item);
410+
$output = $index->getObject($item->AlgoliaUUID);
407411

408412
if ($output) {
409413
return $output;
410414
}
411415
} catch (NotFoundException $ex) {
412416
}
413417
}
418+
419+
return [];
414420
}
415421
}

0 commit comments

Comments
 (0)