From 4b8864872d65e7c7d38707476986fa7758c8854a Mon Sep 17 00:00:00 2001 From: dedekm Date: Thu, 12 May 2022 12:13:11 +0200 Subject: [PATCH] fix current_order --- app/controllers/concerns/boutique/current_order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/boutique/current_order.rb b/app/controllers/concerns/boutique/current_order.rb index bcc1d2cb..5ead3447 100644 --- a/app/controllers/concerns/boutique/current_order.rb +++ b/app/controllers/concerns/boutique/current_order.rb @@ -20,7 +20,7 @@ def current_order updated_at: Time.current) end - if order.user && (order.first_name.blank? || order.last_name.blank?) + if order && order.user && (order.first_name.blank? || order.last_name.blank?) order.update_columns(first_name: order.first_name.presence || current_user.first_name.presence, last_name: order.last_name.presence || current_user.last_name.presence, updated_at: Time.current)