From 6a6be9edde58ab9ad550d0b80ba256006f1a0396 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Sun, 9 Jun 2019 23:47:05 +0530 Subject: [PATCH] on-demand: iOS: Fix crash on selecting Any SSID when already selected Signed-off-by: Roopesh Chander --- .../ViewController/SSIDOptionEditTableViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) 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)