fix: use safe nav when downcasing email in from_email (#9139)
Use safe nav when downcasing email in from_email
This commit is contained in:
@@ -169,7 +169,7 @@ class Contact < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.from_email(email)
|
def self.from_email(email)
|
||||||
find_by(email: email.downcase)
|
find_by(email: email&.downcase)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class User < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.from_email(email)
|
def self.from_email(email)
|
||||||
find_by(email: email.downcase)
|
find_by(email: email&.downcase)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user