Skip to content

Commit

Permalink
fix(core): Fix error in FacetValueChecker on nullish input
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Sep 10, 2024
1 parent cb0672b commit 44aad49
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class FacetValueChecker implements OnModuleInit {
?.ofType(ProductEvent)
.pipe(filter(event => event.type === 'updated'))
.subscribe(async event => {
if ((event.input as UpdateProductInput).facetValueIds) {
if ((event.input as UpdateProductInput)?.facetValueIds) {
const variantIds = await this.connection.rawConnection
.getRepository(ProductVariant)
.createQueryBuilder('variant')
Expand All @@ -94,7 +94,7 @@ export class FacetValueChecker implements OnModuleInit {
const updatedVariantIds: ID[] = [];
if (Array.isArray(event.input)) {
for (const input of event.input) {
if ((input as UpdateProductVariantInput).facetValueIds) {
if ((input as UpdateProductVariantInput)?.facetValueIds) {
updatedVariantIds.push((input as UpdateProductVariantInput).id);
}
}
Expand Down

0 comments on commit 44aad49

Please sign in to comment.