From 4e155641fca1dadb78855597d576ff3510d086b6 Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Fri, 20 Nov 2020 10:32:48 -0800 Subject: [PATCH] fix nil error if no proxy orders found --- lib/tasks/subscriptions/test.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/subscriptions/test.rake b/lib/tasks/subscriptions/test.rake index 9a97b443ae..bfe0e48eb6 100644 --- a/lib/tasks/subscriptions/test.rake +++ b/lib/tasks/subscriptions/test.rake @@ -16,7 +16,7 @@ namespace :ofn do # Reset Proxy Orders of the Order Cycle # by detatching them from existing orders and resetting placed and confirmed dates - ProxyOrder.find_by(order_cycle_id: order_cycle_id).update(order_id: nil, + ProxyOrder.find_by(order_cycle_id: order_cycle_id)&.update(order_id: nil, confirmed_at: nil, placed_at: nil)