Fix crash when trying to cache an empty timeline
This commit is contained in:
parent
e278eae144
commit
fcb7ddcbdb
|
@ -10,6 +10,7 @@ actor TimelineCache {
|
|||
private init() {}
|
||||
|
||||
func set(statuses: [Status], client: Client) {
|
||||
guard !statuses.isEmpty else { return }
|
||||
memoryCache[client] = statuses.prefix(upTo: min(100, statuses.count - 1)).map { $0 }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue