From a354b807fe6034079f45af5d6f4fd5b802e32ada Mon Sep 17 00:00:00 2001 From: Angelo Stavrow Date: Tue, 2 Feb 2021 11:40:01 -0500 Subject: [PATCH] Don't try to log in if the server string isn't valid --- Shared/Account/AccountLoginView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Shared/Account/AccountLoginView.swift b/Shared/Account/AccountLoginView.swift index d420aa1..8284b95 100644 --- a/Shared/Account/AccountLoginView.swift +++ b/Shared/Account/AccountLoginView.swift @@ -71,14 +71,14 @@ struct AccountLoginView: View { hostURL.scheme = scheme hostURL.host = host server = hostURL.string ?? server + model.login( + to: URL(string: server)!, + as: username, password: password + ) } else { model.loginErrorMessage = AccountError.invalidServerURL.localizedDescription model.isPresentingLoginErrorAlert = true } - model.login( - to: URL(string: server)!, - as: username, password: password - ) }, label: { Text("Log In") })