From b2d8818ae158e86147b9627efbe50b4eb0738f87 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 17 Aug 2019 14:43:32 +1200 Subject: [PATCH] don't notify wranglers if there are none --- app/controllers/crops_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/crops_controller.rb b/app/controllers/crops_controller.rb index 89e45a163..8a02e195c 100644 --- a/app/controllers/crops_controller.rb +++ b/app/controllers/crops_controller.rb @@ -139,7 +139,7 @@ class CropsController < ApplicationController def notify_wranglers return if current_member.role? :crop_wrangler - Role.crop_wranglers.each do |w| + Role.crop_wranglers&.each do |w| Notifier.new_crop_request(w, @crop).deliver_now! end end