From 346113966e94b071d77f68ee49e8caae07eaa386 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 22 Aug 2013 11:31:07 +1000 Subject: [PATCH] Prevent exception when order has no payments --- lib/open_food_web/order_and_distributor_report.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_food_web/order_and_distributor_report.rb b/lib/open_food_web/order_and_distributor_report.rb index 04a3596441..6d9556cef7 100644 --- a/lib/open_food_web/order_and_distributor_report.rb +++ b/lib/open_food_web/order_and_distributor_report.rb @@ -21,7 +21,7 @@ module OpenFoodWeb order_and_distributor_details << [order.created_at, order.id, order.bill_address.full_name, order.email, order.bill_address.phone, order.bill_address.city, line_item.product.sku, line_item.product.name, line_item.variant.options_text, line_item.quantity, line_item.max_quantity, line_item.price * line_item.quantity, line_item.distribution_fee, - order.payments.first.payment_method.andand.name, + order.payments.first.andand.payment_method.andand.name, order.distributor.andand.name, order.distributor.address.address1, order.distributor.address.city, order.distributor.address.zipcode, order.special_instructions ] end end