Skip to content

Commit a73ce34

Browse files
authored
Cast to array $attributes
1 parent 6fc1905 commit a73ce34

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

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

163-
$attributes = $attributes === null ? [] : $attributes;
164163
$data = [
165164
'data' => [
166165
'template' => 'Magento_Catalog::product/image_with_borders.phtml',
@@ -169,7 +168,7 @@ public function create(Product $product, string $imageId, array $attributes = nu
169168
'height' => $imageMiscParams['image_height'],
170169
'label' => $this->getLabel($product, $imageMiscParams['image_type']),
171170
'ratio' => $this->getRatio($imageMiscParams['image_width'], $imageMiscParams['image_height']),
172-
'custom_attributes' => $this->getStringCustomAttributes($attributes),
171+
'custom_attributes' => $this->getStringCustomAttributes((array) $attributes),
173172
'class' => $this->getClass($attributes),
174173
'product_id' => $product->getId()
175174
],

0 commit comments

Comments
 (0)