Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit ed6a2fb

Browse files
committed
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 f710f9b commit ed6a2fb

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
@@ -141,7 +141,7 @@ public function getItems($entityType, $attributeCode)
141141
*/
142142
protected function validateOption($attribute, $optionId)
143143
{
144-
if (!$attribute->getSource()->getOptionText($optionId)) {
144+
if ($attribute->getSource()->getOptionText($optionId) === false) {
145145
throw new NoSuchEntityException(
146146
__(
147147
'The "%1" attribute doesn\'t include an option with "%2" ID.',

0 commit comments

Comments
 (0)