From 60ea8f3355f0f471dc491535f322b71c1e5c3ed9 Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 18 Sep 2020 11:48:50 +0200 Subject: [PATCH] fix(orders): the order collection does not crash anymore if no customer is present --- lib/forest_liana/collections/order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/forest_liana/collections/order.rb b/lib/forest_liana/collections/order.rb index 3aeefae..e2bbc7f 100644 --- a/lib/forest_liana/collections/order.rb +++ b/lib/forest_liana/collections/order.rb @@ -4,6 +4,6 @@ class Forest::Order collection :Order belongs_to :delivery_address, reference: 'Address.id' do - object.customer.address + object.customer ? object.customer.address : nil end end