From 3ee0830b658f6c96a5d1c0a336c18391de356293 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Sat, 24 Oct 2020 12:13:34 +0200 Subject: [PATCH] Only connect to the server if not all whitespace --- source/ConnectionAssistant.d | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/ConnectionAssistant.d b/source/ConnectionAssistant.d index 09e1a9b..fc8c959 100644 --- a/source/ConnectionAssistant.d +++ b/source/ConnectionAssistant.d @@ -143,9 +143,14 @@ public final class ConnectionAssistant : Assistant string accountPassword = password.getBuffer().getText(); /* TODO: Check for emptiness */ - - - /* Create a new Connection */ - gui.connectServer(serverAddress, to!(ushort)(serverPort), [accountUsername, accountPassword]); + if(cmp(serverAddress, "") == 0 || cmp(serverPort, "") == 0 || cmp(accountUsername, "") == 0 || cmp(accountPassword, "") == 0) + { + /* TODO: Handle error here */ + } + else + { + /* Create a new Connection */ + gui.connectServer(serverAddress, to!(ushort)(serverPort), [accountUsername, accountPassword]); + } } } \ No newline at end of file