Fix error decoding certain statuses on pixelfed

This commit is contained in:
Shadowfacts 2023-11-19 22:52:58 -05:00
parent 6d7074e71d
commit 0f70c9059e
1 changed files with 2 additions and 1 deletions

View File

@ -66,7 +66,8 @@ public final class Status: StatusProtocol, Decodable, Sendable {
self.inReplyToID = try container.decodeIfPresent(String.self, forKey: .inReplyToID)
self.inReplyToAccountID = try container.decodeIfPresent(String.self, forKey: .inReplyToAccountID)
self.reblog = try container.decodeIfPresent(Status.self, forKey: .reblog)
self.content = try container.decode(String.self, forKey: .content)
// pixelfed statuses may have null content
self.content = try container.decodeIfPresent(String.self, forKey: .content) ?? ""
self.createdAt = try container.decode(Date.self, forKey: .createdAt)
self.emojis = try container.decodeIfPresent([Emoji].self, forKey: .emojis) ?? []
self.reblogsCount = try container.decode(Int.self, forKey: .reblogsCount)