Skip to content

Commit 609c975

Browse files
committed
38. add nullsafe check for countryOfOrigin
1 parent fe3bb7b commit 609c975

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/Listeners/OneC/UpdateProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function handle(ProductCreated|ProductUpdated $event): void
2929
$productFromOneC->update(array_filter([
3030
'SP6111' => url($product->getUrl()),
3131
'SP6116' => $product->getFirstMediaUrl(conversionName: 'catalog'),
32-
'SP6122' => $product->countryOfOrigin->name,
32+
'SP6122' => $product->countryOfOrigin?->name,
3333
'SP6123' => $product->manufacturer?->name,
3434
'SP6124' => $product->category->name,
3535
], fn ($value) => !is_null($value)));

0 commit comments

Comments
 (0)