Skip to content

Commit

Permalink
Merge pull request #2040 from dimasch/patch-2
Browse files Browse the repository at this point in the history
Check on null for state of payment-backend-methods
  • Loading branch information
pkarw authored Nov 30, 2018
2 parents 6b12be0 + 87e0557 commit 50b2901
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 50b2901

Please sign in to comment.