Browse Source

fix a index out of bounds crash

Simon Laux 2 years ago
parent
commit
1ac77d06ff
1 changed files with 1 additions and 1 deletions
  1. 1 1
      deltachat-ios/ViewModel/ChatListViewModel.swift

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

@@ -128,7 +128,7 @@ class ChatListViewModel: NSObject {
 
     // only visible on search results
     func titleForHeaderIn(section: Int) -> String? {
-        if showSearchResults {
+        if showSearchResults && !searchResultSections.isEmpty {
             switch searchResultSections[section] {
             case .chats:
                 return String.localized(stringID: "n_chats", count: numberOfRowsIn(section: section))