Explorar el Código

fix(core): Fix undefined reference error in product variant resolver

Michael Bromley hace 1 año
padre
commit
5afa6bcad8

+ 1 - 1
packages/core/src/api/resolvers/entity/product-variant-entity.resolver.ts

@@ -79,7 +79,7 @@ export class ProductVariantEntityResolver {
         @Ctx() ctx: RequestContext,
         @Parent() productVariant: ProductVariant,
     ): Promise<Product | undefined> {
-        if (productVariant.product.name) {
+        if (productVariant.product?.name) {
             return productVariant.product;
         }