From 9bd06336eb224a2d474237c7dabeec06b1bdcc7f Mon Sep 17 00:00:00 2001 From: delvh Date: Mon, 31 Aug 2020 09:02:07 +0200 Subject: [PATCH] Fixed bug not allowing users without command line arguments --- .../src/main/java/envoy/client/data/ClientConfig.java | 10 ++++++++-- client/src/main/resources/client.properties | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/envoy/client/data/ClientConfig.java b/client/src/main/java/envoy/client/data/ClientConfig.java index 60196de..c6d4158 100644 --- a/client/src/main/java/envoy/client/data/ClientConfig.java +++ b/client/src/main/java/envoy/client/data/ClientConfig.java @@ -68,13 +68,19 @@ public final class ClientConfig extends Config { * @return the user name * @since Envoy Client v0.3-alpha */ - public String getUser() { return (String) items.get("user").get(); } + public String getUser() { + final String user = (String) items.get("user").get(); + return user.equals("") ? null : user; + } /** * @return the password * @since Envoy Client v0.3-alpha */ - public String getPassword() { return (String) items.get("password").get(); } + public String getPassword() { + final String password = (String) items.get("password").get(); + return password.equals("") ? null : password; + } /** * @return {@code true} if user name and password are set diff --git a/client/src/main/resources/client.properties b/client/src/main/resources/client.properties index 6f3d633..8b0e4dc 100644 --- a/client/src/main/resources/client.properties +++ b/client/src/main/resources/client.properties @@ -1,6 +1,8 @@ server=localhost port=8080 localDB=localDB +password= +user= +ignoreLocalDB=false consoleLevelBarrier=FINER fileLevelBarrier=OFF -ignoreLocalDB=false