Skip to content

Commit 6adf548

Browse files
authored
Revert previous cast commit
This cast causes Exception sometimes cause $attributes value must be "string" instead of null, and then we need to check if value is null.
1 parent a73ce34 commit 6adf548

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Catalog/Block/Product/ImageFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ public function create(Product $product, string $imageId, array $attributes = nu
160160
);
161161
}
162162

163+
$attributes = $attributes === null ? [] : $attributes;
164+
163165
$data = [
164166
'data' => [
165167
'template' => 'Magento_Catalog::product/image_with_borders.phtml',
@@ -168,7 +170,7 @@ public function create(Product $product, string $imageId, array $attributes = nu
168170
'height' => $imageMiscParams['image_height'],
169171
'label' => $this->getLabel($product, $imageMiscParams['image_type']),
170172
'ratio' => $this->getRatio($imageMiscParams['image_width'], $imageMiscParams['image_height']),
171-
'custom_attributes' => $this->getStringCustomAttributes((array) $attributes),
173+
'custom_attributes' => $this->getStringCustomAttributes($attributes),
172174
'class' => $this->getClass($attributes),
173175
'product_id' => $product->getId()
174176
],

0 commit comments

Comments
 (0)