Skip to content

Commit

Permalink
context_classをnil safeに書き換え
Browse files Browse the repository at this point in the history
  • Loading branch information
kokuyouwind committed Oct 16, 2023
1 parent 54576d7 commit 077bbd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/apm_traceable/adapters/datadog_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def trace(trace_name, context_class:, **options, &block)

def resource_name(context_class)
# include 先のクラス名を利用して `admin.users_controller` のような文字列を作る
context_class.name.underscore&.tr('/', '.')
(context_class&.name || 'UnknownClass').underscore&.tr('/', '.')
end
end
end
Expand Down

0 comments on commit 077bbd3

Please sign in to comment.