Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
VP-1948: Fix possible null reference exception
Browse files Browse the repository at this point in the history
  • Loading branch information
yecli committed Apr 17, 2020
1 parent e5e9f21 commit c65e38b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/common-components/paymentMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ storefrontApp.component('vcPaymentMethods', {
ctrl.availPaymentMethods = _.sortBy(methods, function (x) { return x.priority; });
if (ctrl.paymentMethod) {
ctrl.paymentMethod = _.findWhere(ctrl.availPaymentMethods, { code: ctrl.paymentMethod.code });
ctrl.selectMethod(ctrl.paymentMethod);

if (ctrl.paymentMethod) {
ctrl.selectMethod(ctrl.paymentMethod);
}
}
if (!ctrl.paymentMethod && ctrl.availPaymentMethods.length > 0) {
ctrl.selectMethod(ctrl.availPaymentMethods[0]);
Expand Down

0 comments on commit c65e38b

Please sign in to comment.