on-demand: iOS: Fix crash on selecting Any SSID when already selected

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-06-09 23:47:05 +05:30
parent 37f8500fe6
commit 6a6be9edde
1 changed files with 4 additions and 0 deletions

View File

@ -266,6 +266,10 @@ extension SSIDOptionEditTableViewController {
case .ssidOption:
let previousOption = selectedOption
selectedOption = ssidOptionFields[indexPath.row]
guard previousOption != selectedOption else {
tableView.deselectRow(at: indexPath, animated: true)
return
}
loadSections()
if previousOption == .anySSID {
let indexSet = IndexSet(1 ... 2)