Check if the logger exists before trying to use it

上级 bbbabc22
......@@ -19,7 +19,7 @@ def process_action(action, *args)
end
def cleanup_view_runtime
if logger.info? && ActiveRecord::Base.connected?
if logger && logger.info? && ActiveRecord::Base.connected?
db_rt_before_render = ActiveRecord::LogSubscriber.reset_runtime
self.db_runtime = (db_runtime || 0) + db_rt_before_render
runtime = super
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册