aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-06-09 23:47:05 +0530
committerRoopesh Chander <roop@roopc.net>2019-06-09 23:55:44 +0530
commite22a12f6d7ae56521bda79bb3665cdbb76e047ae (patch)
treedda8f526780dc4cea270e6299aeb84cde023813c
parenton-demand: Don't crash on encountering unexpected on-demand rules (diff)
downloadwireguard-apple-e22a12f6d7ae56521bda79bb3665cdbb76e047ae.tar.xz
wireguard-apple-e22a12f6d7ae56521bda79bb3665cdbb76e047ae.zip
on-demand: iOS: Fix crash on selecting Any SSID when already selected
-rw-r--r--WireGuard/WireGuard/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift4
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift
index 1256f56..8740f06 100644
--- a/WireGuard/WireGuard/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift
@@ -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)