Skip to content

Commit 06ca13a

Browse files
pmclaingelanivishal
authored andcommitted
Prevent exception when option text converts to false
The function would incorrectly through an exception when the option text was set to a string that would evaluate to false such as "0" Fixes #13083
1 parent 0f57a30 commit 06ca13a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Eav/Model/Entity/Attribute/OptionManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function getItems($entityType, $attributeCode)
132132
*/
133133
protected function validateOption($attribute, $optionId)
134134
{
135-
if (!$attribute->getSource()->getOptionText($optionId)) {
135+
if ($attribute->getSource()->getOptionText($optionId) === false) {
136136
throw new NoSuchEntityException(
137137
__('Attribute %1 does not contain option with Id %2', $attribute->getAttributeCode(), $optionId)
138138
);

0 commit comments

Comments
 (0)