FIX: current_user should be called only if controller have that method

This commit is contained in:
Vinoth Kannan 2017-12-07 23:12:34 +05:30
parent ef0d9d631c
commit 19247f9087
1 changed files with 1 additions and 1 deletions

View File

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