From b9c6425f2877608d600f3473372276faf7003e93 Mon Sep 17 00:00:00 2001 From: Dustin Steiner Date: Thu, 27 Feb 2025 11:04:08 +0000 Subject: [PATCH] fix: allow empty account display_name for pixelfed notifications and set to empty string Signed-off-by: Dustin Steiner --- Packages/Pachyderm/Sources/Pachyderm/Model/Account.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/Pachyderm/Sources/Pachyderm/Model/Account.swift b/Packages/Pachyderm/Sources/Pachyderm/Model/Account.swift index 3359b8d7..db1fc5d3 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Model/Account.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Model/Account.swift @@ -37,7 +37,7 @@ public final class Account: AccountProtocol, Decodable, Sendable { self.id = try container.decode(String.self, forKey: .id) self.username = try container.decode(String.self, forKey: .username) self.acct = try container.decode(String.self, forKey: .acct) - self.displayName = try container.decode(String.self, forKey: .displayName) + self.displayName = try container.decodeIfPresent(String.self, forKey: .displayName) ?? "" self.locked = try container.decode(Bool.self, forKey: .locked) self.createdAt = try container.decode(Date.self, forKey: .createdAt) // some instance types (pixelfed, firefish) seem to sometimes send null for these fields, so just fallback to 0