Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 429a012

Browse files
committed
fix: verify that the product image attribute exists before requesting the value
1 parent 73b9e45 commit 429a012

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/MagentoProduct.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function productImage($key)
8787
{
8888
$attribute = $this->customAttributes->where('attribute_type', 'image')->first();
8989

90-
if (Storage::exists('public/product/'. $attribute->value)) {
90+
if ($attribute && Storage::exists('public/product/'. $attribute->value)) {
9191
return 'product/'. $attribute->value;
9292
}
9393

0 commit comments

Comments
 (0)