File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,14 @@ def user_context
2424
2525 def tags_context
2626 { controller_name : } . tap do |tags |
27- if current_user . present?
28- sign_in = current_user . respond_to? ( :identity ) ? current_user . identity . sign_in : current_user . sign_in
27+ # Add defensive checks to avoid nil errors
28+ sign_in = if current_user &.respond_to? ( :identity ) && current_user . identity &.sign_in . present? # rubocop:disable Lint/RedundantSafeNavigation
29+ current_user . identity . sign_in
30+ elsif current_user &.sign_in . present?
31+ current_user . sign_in
32+ end
33+
34+ if sign_in . present?
2935 tags [ :sign_in_method ] = sign_in [ :service_name ]
3036 # account_type is filtered by sentry, becasue in other contexts it refers to a bank account type
3137 tags [ :sign_in_acct_type ] = sign_in [ :account_type ]
You can’t perform that action at this time.
0 commit comments