Skip to content

Commit

Permalink
Added validation for Product's attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
Returnless committed Jan 3, 2023
1 parent 8094ea3 commit b4455e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Model/Api/OrderInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ protected function getUBrand($product)
$brandAttributeCode = !empty($brandAttributeCode) ? $brandAttributeCode : null;

$uBrand = null;
if (!empty($brandAttributeCode)) {
if (!empty($brandAttributeCode) && $product->getResource()->getAttribute($brandAttributeCode)) {
$uBrand = $product->getResource()->getAttribute($brandAttributeCode)->getFrontend()->getValue($product);
}

Expand Down

0 comments on commit b4455e5

Please sign in to comment.