Skip to content

Commit 0d904ab

Browse files
committed
checking attribute
1 parent 24ebc2e commit 0d904ab

File tree

1 file changed

+4
-1
lines changed
  • app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query

1 file changed

+4
-1
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ private function buildSearchCriteria(array $args, ResolveInfo $info): SearchCrit
154154
*/
155155
private function getAttributeLabel(Product $product, $field)
156156
{
157-
return $product->getResource()->getAttribute($field)->getFrontend()->getValue($product);
157+
$attribute = $product->getResource()->getAttribute($field);
158+
if ($attribute) {
159+
return $attribute->getFrontend()->getValue($product);
160+
}
158161
}
159162
}

0 commit comments

Comments
 (0)