From 5121d14b5585be22e410ed24f2f2cb8bcf9e4a7b Mon Sep 17 00:00:00 2001 From: maride Date: Sat, 5 Apr 2025 17:32:44 +0200 Subject: [PATCH] Fix: catch empty e-mail addresses --- common/types/User.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/types/User.swift b/common/types/User.swift index 0b54622..f815549 100644 --- a/common/types/User.swift +++ b/common/types/User.swift @@ -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()