Fixed exception if octopart did not returned an category for a part

This commit is contained in:
Jan Böhmer 2023-07-31 22:21:08 +02:00
parent ffe76f9d2e
commit 5750e7dbdf

View file

@ -294,7 +294,7 @@ class OctopartProvider implements InfoProviderInterface
//Built the category full path
$category = null;
if ($part['category']['name'] !== null) {
if (!empty($part['category']['name'])) {
$category = implode(' -> ', array_map(fn($c) => $c['name'], $part['category']['ancestors'] ?? []));
if (!empty($category)) {
$category .= ' -> ';