From: Roopesh Chander Date: Sun, 9 Jun 2019 18:17:05 +0000 (+0530) Subject: on-demand: iOS: Fix crash on selecting Any SSID when already selected X-Git-Tag: 0.0.20190610-12~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a6be9edde58ab9ad550d0b80ba256006f1a0396;p=thirdparty%2Fwireguard-apple.git on-demand: iOS: Fix crash on selecting Any SSID when already selected Signed-off-by: Roopesh Chander --- 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)