Fix crash when clearing URL field and pressing Go

This commit is contained in:
Shadowfacts 2021-06-15 23:33:29 -04:00
parent e5f520cf6f
commit dd0dcbde9c
1 changed files with 3 additions and 1 deletions

View File

@ -77,7 +77,9 @@ class NavigationBarView: UIView {
@objc private func commitURL() { @objc private func commitURL() {
textField.resignFirstResponder() textField.resignFirstResponder()
if let text = textField.text, var components = URLComponents(string: text) { if let text = textField.text,
!text.isEmpty,
var components = URLComponents(string: text) {
if components.scheme == nil { if components.scheme == nil {
components.scheme = "gemini" components.scheme = "gemini"
} }