Fix: catch empty e-mail addresses

This commit is contained in:
2025-04-05 17:32:44 +02:00
parent 9984f2c943
commit 5121d14b55
+1 -1
View File
@@ -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 // 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. // 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 // 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 { ).compactMap {
String(format: "%02x", $0) String(format: "%02x", $0)
}.joined() }.joined()