Skip to content

Commit 338bdaf

Browse files
authored
Merge pull request #565 from bugsnag/tom/active-record-missing-binds-key
fix(rails): fix nil dereference in SQL Active Record `bind` key
2 parents e938bce + ea1a6fb commit 338bdaf

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Changelog
22
=========
33

4+
## TBC
5+
6+
### Fixes
7+
8+
* Account for missing `:binds` key in `sql.active_record` ActiveSupport notifications
9+
| [#555](https://github.com/bugsnag/bugsnag-ruby/issues/555)
10+
| [#565](https://github.com/bugsnag/bugsnag-ruby/pull/565)
11+
412
## 6.12.0 (28 Aug 2019)
513

614
### Enhancements

lib/bugsnag/integrations/railtie.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def event_subscription(event)
7979
filtered_data = data.slice(*event[:allowed_data])
8080
filtered_data[:event_name] = event[:id]
8181
filtered_data[:event_id] = event_id
82-
if event[:id] == "sql.active_record"
82+
if event[:id] == "sql.active_record" && data.key?(:binds)
8383
binds = data[:binds].each_with_object({}) { |bind, output| output[bind.name] = '?' if defined?(bind.name) }
8484
filtered_data[:binds] = JSON.dump(binds) unless binds.empty?
8585
end

0 commit comments

Comments
 (0)