payments: Add check for null (deleted) payment method prior extracting plugin name
@@ -106,8 +106,11 @@ public class DefaultControlInitiated implements LeavingStateCallback {
// In this case, we also want to provide the associated plugin name
if (stateContext.getPaymentMethodId() != null) {
final PaymentMethodModelDao pm = paymentDao.getPaymentMethod(stateContext.getPaymentMethodId(), stateContext.getInternalCallContext());
+ // Payment method was deleted
+ if (pm != null) {
stateContext.setOriginalPaymentPluginName(pm.getPluginName());
}
+ }
if (state.getName().equals(initialState.getName()) || state.getName().equals(retriedState.getName())) {
