Skip to content

Commit

Permalink
CV2-4604: fix sentry error (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy authored May 27, 2024
1 parent 73a1c18 commit b4b1ee5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/mailers/security_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def notify(user_id, type, activity_id)
activity = LoginActivity.find_by_id(activity_id)
address = []
Geocoder.configure(language: I18n.locale)
ip_result = Geocoder.search(activity.ip).first
ip_result = Geocoder.search(activity&.ip)&.first
unless ip_result.blank? || ip_result.data["loc"].blank?
loc_result = Geocoder.search(ip_result.data["loc"]).first
address = [loc_result.city, loc_result.country] unless loc_result.nil?
Expand Down

0 comments on commit b4b1ee5

Please sign in to comment.