Skip to content

Commit 951d5e8

Browse files
author
Tommy Quissens
committed
parse nil values correctly
1 parent ca47981 commit 951d5e8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/Catalog/Model/ImageExtractor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ public function process(\DOMElement $mediaNode, $mediaParentTag)
3535
if ($attributeTagName === 'background') {
3636
$nodeValue = $this->processImageBackground($attribute->nodeValue);
3737
} elseif ($attributeTagName === 'width' || $attributeTagName === 'height') {
38-
$nodeValue = intval($attribute->nodeValue);
38+
if ((bool)$attribute->getAttribute('xsi:nil') !== true) {
39+
$nodeValue = intval($attribute->nodeValue);
40+
} else {
41+
$nodeValue = null;
42+
}
3943
} else {
4044
$nodeValue = $attribute->nodeValue;
4145
}

0 commit comments

Comments
 (0)