mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-02-18 10:45:15 +00:00
Fix crash when trying to cache an empty timeline
This commit is contained in:
parent
e278eae144
commit
fcb7ddcbdb
1 changed files with 1 additions and 0 deletions
|
@ -10,6 +10,7 @@ actor TimelineCache {
|
||||||
private init() {}
|
private init() {}
|
||||||
|
|
||||||
func set(statuses: [Status], client: Client) {
|
func set(statuses: [Status], client: Client) {
|
||||||
|
guard !statuses.isEmpty else { return }
|
||||||
memoryCache[client] = statuses.prefix(upTo: min(100, statuses.count - 1)).map { $0 }
|
memoryCache[client] = statuses.prefix(upTo: min(100, statuses.count - 1)).map { $0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue