diff --git a/lib/rate_limiter/on_create_record.rb b/lib/rate_limiter/on_create_record.rb index a9a0d7ed285..4232ab9a7f8 100644 --- a/lib/rate_limiter/on_create_record.rb +++ b/lib/rate_limiter/on_create_record.rb @@ -13,7 +13,7 @@ class RateLimiter return @rate_limiter if @rate_limiter.present? limit_key = "create_#{self.class.name.underscore}" - max_setting = if user.new_user? and SiteSetting.has_setting?("rate_limit_new_user_#{limit_key}") + max_setting = if user && user.new_user? and SiteSetting.has_setting?("rate_limit_new_user_#{limit_key}") SiteSetting.send("rate_limit_new_user_#{limit_key}") else SiteSetting.send("rate_limit_#{limit_key}")