Fix: catch empty e-mail addresses
This commit is contained in:
@@ -28,7 +28,7 @@ struct User: Decodable, Identifiable, Hashable {
|
||||
// e-mails may be empty as they are not required during the registration process in Mete
|
||||
// however, Gravatar requires them for the profile picture functionality.
|
||||
// Default to the profile picture of md5("0"), which is simply the Gravatar logo on blue background
|
||||
data: (try container.decode(String.self, forKey: .email).data(using: .utf8)) ?? "0".data(using: .utf8)!
|
||||
data: (((try? container.decode(String.self, forKey: .email)) ?? "0").data(using: .utf8)!)
|
||||
).compactMap {
|
||||
String(format: "%02x", $0)
|
||||
}.joined()
|
||||
|
||||
Reference in New Issue
Block a user