Fix two crashes

This commit is contained in:
Thomas Ricouard 2023-02-18 17:08:32 +01:00
parent bfce92d71e
commit b1424aadd0
2 changed files with 2 additions and 1 deletions

View file

@ -47,7 +47,7 @@ public struct ServerDate: Codable, Hashable, Equatable {
// Decode from server
let container = try decoder.singleValueContainer()
let stringDate = try container.decode(String.self)
asDate = Self.createdAtDateFormatter.date(from: stringDate)!
asDate = Self.createdAtDateFormatter.date(from: stringDate) ?? Date()
} catch {
// Decode from cache
let container = try decoder.container(keyedBy: CodingKeys.self)

View file

@ -235,6 +235,7 @@ public struct StatusEditorView: View {
avatarSize: .status)
} else {
AvatarView(url: account.avatar, size: .status)
.environmentObject(theme)
}
VStack(alignment: .leading, spacing: 4) {
privacyMenu