diff --git a/lib/open_food_network/feature_toggle.rb b/lib/open_food_network/feature_toggle.rb index 12aaa90a038..5ee51a82f9b 100644 --- a/lib/open_food_network/feature_toggle.rb +++ b/lib/open_food_network/feature_toggle.rb @@ -31,6 +31,8 @@ def self.enabled?(feature_name, user = nil) end def self.enable(feature_name, user_emails) + return unless user_emails.present? + Thread.current[:features] ||= {} Thread.current[:features][feature_name] = Feature.new(user_emails) end