Skip to content

Commit c8b6de6

Browse files
committed
Check if child is null before adding it to variants array. See #736
1 parent f29c407 commit c8b6de6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/ConfigurableProductGraphQl/Model/Resolver/ConfigurableVariant.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
9595
$variants = [];
9696
/** @var Product $child */
9797
foreach ($children as $key => $child) {
98-
$variants[$key] = ['sku' => $child['sku'], 'product' => $child, 'options' => $options];
98+
if($child != null) {
99+
$variants[$key] = ['sku' => $child['sku'], 'product' => $child, 'options' => $options];
100+
}
99101
}
100102

101103
return $variants;

0 commit comments

Comments
 (0)