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)