From 71a181341b48bde6dc640d164137567e1c78dcf0 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Thu, 29 Oct 2020 15:56:41 +0000 Subject: [PATCH] Fix bug in terms_and_conditions_helper related to guest checkout where current_user is nil and T&Cs must be shown all the time --- app/helpers/terms_and_conditions_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/terms_and_conditions_helper.rb b/app/helpers/terms_and_conditions_helper.rb index e748b520ec..ef50459edb 100644 --- a/app/helpers/terms_and_conditions_helper.rb +++ b/app/helpers/terms_and_conditions_helper.rb @@ -6,7 +6,7 @@ module TermsAndConditionsHelper end def terms_and_conditions_already_accepted? - customer_terms_and_conditions_accepted_at = spree_current_user. + customer_terms_and_conditions_accepted_at = spree_current_user&. customer_of(current_order.distributor)&.terms_and_conditions_accepted_at customer_terms_and_conditions_accepted_at.present? &&