Skip to content

Commit

Permalink
Defend from nil BETA_TESTERS var
Browse files Browse the repository at this point in the history
  • Loading branch information
sauloperez committed Jan 11, 2021
1 parent dfed20d commit 33c72ec
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/open_food_network/feature_toggle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 33c72ec

Please sign in to comment.