From ea49ca7ef52b72c1cdfb583d9009748c25694084 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 18 Feb 2020 15:45:44 +0000 Subject: [PATCH] DEV: Handle nil backtraces in pg access logs --- config/initializers/000-trace_pg_connections.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/000-trace_pg_connections.rb b/config/initializers/000-trace_pg_connections.rb index bdf74316cc4..03968bba1bb 100644 --- a/config/initializers/000-trace_pg_connections.rb +++ b/config/initializers/000-trace_pg_connections.rb @@ -44,11 +44,11 @@ if ENV["TRACE_PG_CONNECTIONS"] #{@accessor_thread} was using the connection. Backtrace: - #{@accessor_thread.backtrace.join("\n")} + #{@accessor_thread&.backtrace&.join("\n")} #{Thread.current} is now attempting to use the connection. Backtrace: - #{Thread.current.backtrace.join("\n")} + #{Thread.current&.backtrace&.join("\n")} STRING end @accessor_thread = Thread.current