Skip to content

Commit

Permalink
fix: safe navigate adapter_name for payload connection (#593)
Browse files Browse the repository at this point in the history
In some cases, the payload connection may be nil, which we should handle
gracefully.
  • Loading branch information
roelbondoc authored Jul 23, 2024
1 parent 73b5d15 commit 368fb16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/honeybadger/notification_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def format_payload(payload)
class ActiveRecordSubscriber < NotificationSubscriber
def format_payload(payload)
{
query: Util::SQL.obfuscate(payload[:sql], payload[:connection].adapter_name),
query: Util::SQL.obfuscate(payload[:sql], payload[:connection]&.adapter_name),
async: payload[:async]
}
end
Expand Down

0 comments on commit 368fb16

Please sign in to comment.