forked from shadowfacts/Tusker
Fix error when decoding notification that has a status field but is null
This commit is contained in:
parent
802a0ac9ba
commit
9d1c3f1410
|
@ -30,11 +30,7 @@ public class Notification: Decodable {
|
|||
}
|
||||
self.createdAt = try container.decode(Date.self, forKey: .createdAt)
|
||||
self.account = try container.decode(Account.self, forKey: .account)
|
||||
if container.contains(.status) {
|
||||
self.status = try container.decode(Status.self, forKey: .status)
|
||||
} else {
|
||||
self.status = nil
|
||||
}
|
||||
self.status = try container.decodeIfPresent(Status.self, forKey: .status)
|
||||
}
|
||||
|
||||
public static func dismiss(id notificationID: String) -> Request<Empty> {
|
||||
|
|
Loading…
Reference in New Issue