Tunnel edit: Fix crash
This fixes a crash that happens when you: 1. Scroll to the end of the Edit screen 2. Delete a peer 3. Toggle the Activate On Demand switch Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
@@ -417,7 +417,8 @@ extension TunnelEditTableViewController {
|
|||||||
self.activateOnDemandSetting.isActivateOnDemandEnabled = isOn
|
self.activateOnDemandSetting.isActivateOnDemandEnabled = isOn
|
||||||
self.loadSections()
|
self.loadSections()
|
||||||
|
|
||||||
let indexPaths = (1 ..< 4).map { IndexPath(row: $0, section: indexPath.section) }
|
let section = self.sections.firstIndex(where: { $0 == .onDemand })!
|
||||||
|
let indexPaths = (1 ..< 4).map { IndexPath(row: $0, section: section) }
|
||||||
if isOn {
|
if isOn {
|
||||||
if self.activateOnDemandSetting.activateOnDemandOption == .none {
|
if self.activateOnDemandSetting.activateOnDemandOption == .none {
|
||||||
self.activateOnDemandSetting.activateOnDemandOption = TunnelViewModel.defaultActivateOnDemandOption()
|
self.activateOnDemandSetting.activateOnDemandOption = TunnelViewModel.defaultActivateOnDemandOption()
|
||||||
|
|||||||
Reference in New Issue
Block a user