Skip to content

Commit

Permalink
fix(core): Handle undefined reference in customerGroup condition
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Dec 29, 2020
1 parent c1e58e7 commit 0eaffc1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CustomerGroupEvent } from '../../../event-bus/events/customer-group-eve
import { PromotionCondition } from '../promotion-condition';

let customerService: import('../../../service/services/customer.service').CustomerService;
let subscription: Subscription;
let subscription: Subscription | undefined;

const fiveMinutes = 5 * 60 * 1000;
const cache = new TtlCache<ID, ID[]>({ ttl: fiveMinutes });
Expand Down Expand Up @@ -40,7 +40,7 @@ export const customerGroup = new PromotionCondition({
});
},
destroy() {
subscription.unsubscribe();
subscription?.unsubscribe();
},
async check(ctx, order, args) {
if (!order.customer) {
Expand Down

0 comments on commit 0eaffc1

Please sign in to comment.