Pārlūkot izejas kodu

Merge pull request #1833 from deltachat/simon/fix-out-of-bounds-error-in-search

fix out of bounds error in search
Simon Laux 2 gadi atpakaļ
vecāks
revīzija
5f0df62904
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      deltachat-ios/ViewModel/ChatListViewModel.swift

+ 1 - 1
deltachat-ios/ViewModel/ChatListViewModel.swift

@@ -103,7 +103,7 @@ class ChatListViewModel: NSObject {
     }
 
     func cellDataFor(section: Int, row: Int) -> AvatarCellViewModel {
-        if showSearchResults {
+        if showSearchResults && !searchResultSections.isEmpty {
             switch searchResultSections[section] {
             case .chats:
                 return makeChatCellViewModel(index: row, searchText: searchText)