From 40dead89e5badd2b1b4397c1ea08f662ef7cb9e6 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 5 May 2017 17:14:12 -0400 Subject: [PATCH] don't crash invite flow when contacts disabled // FREEBIE --- Signal/src/ViewControllers/ContactsPicker.swift | 8 ++++++++ 1 file changed, 8 insertions(+) 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