Skip to content

Commit 4bb1097

Browse files
authored
Fix adding an option with label '0'
Fix adding an attribute option to a product with the label '0'
1 parent 227cf92 commit 4bb1097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public function update(
9393
if (empty($optionId)) {
9494
throw new InputException(__('The option id is empty. Enter the value and try again.'));
9595
}
96-
$label = trim($option->getLabel() ?: '');
97-
if (empty($label)) {
96+
$label = trim((string) $option->getLabel());
97+
if ($label === '') {
9898
throw new InputException(__('The attribute option label is empty. Enter the value and try again.'));
9999
}
100100
if ($attribute->getSource()->getOptionText($optionId) === false) {

0 commit comments

Comments
 (0)