diff --git a/lib/admin_constraint.rb b/lib/admin_constraint.rb index 923e5e806c0..0ee711c2bca 100644 --- a/lib/admin_constraint.rb +++ b/lib/admin_constraint.rb @@ -10,6 +10,8 @@ class AdminConstraint return false if @require_master && RailsMultisite::ConnectionManagement.current_db != "default" provider = Discourse.current_user_provider.new(request.env) provider.current_user && provider.current_user.admin? + rescue Discourse::InvalidAccess + false end end