FIX: Rescue if default_current_user_provider raised an error

This commit is contained in:
Vinoth Kannan 2017-12-08 01:42:55 +05:30
parent 3cf4886d3e
commit 58aeaef0c4
1 changed files with 2 additions and 1 deletions

View File

@ -9,9 +9,10 @@ if (Rails.env.production? && SiteSetting.logging_provider == 'lograge') || ENV["
config.lograge.enabled = true
config.lograge.custom_payload do |controller|
username = controller.try(:current_user)&.username rescue nil
{
ip: controller.request.remote_ip,
username: controller.try(:current_user)&.username,
username: username,
}
end