Fix crash when open git server view controller
This commit is contained in:
parent
c2562d31d1
commit
f0ca07187c
1 changed files with 8 additions and 5 deletions
|
|
@ -41,9 +41,9 @@ class GitServerSettingTableViewController: UITableViewController {
|
||||||
override func viewWillAppear(_ animated: Bool) {
|
override func viewWillAppear(_ animated: Bool) {
|
||||||
super.viewWillAppear(animated)
|
super.viewWillAppear(animated)
|
||||||
// Grey out ssh option if ssh_key and ssh_key.pub are not present
|
// Grey out ssh option if ssh_key and ssh_key.pub are not present
|
||||||
sshLabel = authSSHKeyCell.subviews[0].subviews[0] as? UILabel
|
if let sshLabel = sshLabel {
|
||||||
sshLabel!.isEnabled = gitSSHKeyExists()
|
sshLabel.isEnabled = gitSSHKeyExists()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
@ -51,7 +51,7 @@ class GitServerSettingTableViewController: UITableViewController {
|
||||||
gitURLTextField.text = url.absoluteString
|
gitURLTextField.text = url.absoluteString
|
||||||
}
|
}
|
||||||
usernameTextField.text = Defaults[.gitUsername]
|
usernameTextField.text = Defaults[.gitUsername]
|
||||||
|
sshLabel = authSSHKeyCell.subviews[0].subviews[0] as? UILabel
|
||||||
checkAuthenticationMethod(method: authenticationMethod)
|
checkAuthenticationMethod(method: authenticationMethod)
|
||||||
authSSHKeyCell.accessoryType = .detailButton
|
authSSHKeyCell.accessoryType = .detailButton
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +158,10 @@ class GitServerSettingTableViewController: UITableViewController {
|
||||||
let deleteAction = UIAlertAction(title: "Remove Git SSH Keys", style: .destructive) { _ in
|
let deleteAction = UIAlertAction(title: "Remove Git SSH Keys", style: .destructive) { _ in
|
||||||
Utils.removeGitSSHKeys()
|
Utils.removeGitSSHKeys()
|
||||||
Defaults[.gitSSHKeySource] = nil
|
Defaults[.gitSSHKeySource] = nil
|
||||||
self.sshLabel!.isEnabled = false
|
if let sshLabel = self.sshLabel {
|
||||||
|
sshLabel.isEnabled = false
|
||||||
|
self.checkAuthenticationMethod(method: "Password")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
optionMenu.addAction(deleteAction)
|
optionMenu.addAction(deleteAction)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue