diff --git a/core/app/models/spree/payment.rb b/core/app/models/spree/payment.rb index 85c9f753c1d..4b8a4e989c4 100644 --- a/core/app/models/spree/payment.rb +++ b/core/app/models/spree/payment.rb @@ -179,11 +179,11 @@ def validate_source end def source_required? - payment_method.present? && payment_method.source_required? + payment_method&.source_required? end def profiles_supported? - payment_method.respond_to?(:payment_profiles_supported?) && payment_method.payment_profiles_supported? + payment_method.try(:payment_profiles_supported?) end def create_payment_profile