diff --git a/Signal/src/ViewControllers/ContactsPicker.swift b/Signal/src/ViewControllers/ContactsPicker.swift index 1c8297e45..068c6f04d 100644 --- a/Signal/src/ViewControllers/ContactsPicker.swift +++ b/Signal/src/ViewControllers/ContactsPicker.swift @@ -274,7 +274,15 @@ open class ContactsPicker: UIViewController, UITableViewDelegate, UITableViewDat open func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { let dataSource = filteredSections + guard dataSource.count >= section else { + return nil + } + if dataSource[section].count > 0 { + guard collation.sectionTitles.count >= section else { + return nil + } + return collation.sectionTitles[section] } else { return nil