Workaround crash when muting account

This commit is contained in:
vollkorntomate 2022-11-25 15:43:07 +01:00
parent b42dd286e6
commit 457bcd7123
No known key found for this signature in database
GPG key ID: 87384A836B85D103

View file

@ -98,6 +98,10 @@ public class CollectionItemsViewModel: ObservableObject {
// swiftlint:disable:next function_body_length cyclomatic_complexity
public func viewModel(indexPath: IndexPath) -> Any {
guard indexPath.section < lastUpdate.sections.count,
indexPath.item < lastUpdate.sections[indexPath.section].items.count else {
return false
}
let item = lastUpdate.sections[indexPath.section].items[indexPath.item]
let cachedViewModel = viewModelCache[item]