From 87e05578aaae011413288664630e35b7d20956e4 Mon Sep 17 00:00:00 2001 From: Dmitry Schegolihin Date: Thu, 29 Nov 2018 23:19:59 +0400 Subject: [PATCH] Check on null for state of payment-backend-methods --- src/modules/payment-backend-methods/hooks/afterRegistration.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/payment-backend-methods/hooks/afterRegistration.ts b/src/modules/payment-backend-methods/hooks/afterRegistration.ts index 96e3baa2e3..1ba3d863da 100644 --- a/src/modules/payment-backend-methods/hooks/afterRegistration.ts +++ b/src/modules/payment-backend-methods/hooks/afterRegistration.ts @@ -14,7 +14,8 @@ export function afterRegistration(Vue, config, store, isServer) { // Mount the info component when required. Vue.prototype.$bus.$on('checkout-payment-method-changed', (paymentMethodCode) => { - if (store.state['payment-backend-methods'].methods.find(item => item.code === paymentMethodCode)) { + let methods = store.state['payment-backend-methods'].methods + if (methods !== null && methods.find(item => item.code === paymentMethodCode)) { // Register the handler for what happens when they click the place order button. Vue.prototype.$bus.$on('checkout-before-placeOrder', placeOrder) } else {