Skip to content
This repository was archived by the owner on Jun 21, 2019. It is now read-only.

Commit e47d83c

Browse files
author
Max Dor
authored
Merge pull request #18 from MrCustomizer/fixEmptyLinesBug
Ignore empty lines in config file
2 parents d489f46 + a49e1ed commit e47d83c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/test/java/io/kamax/matrix/client/MatrixHttpTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ protected InputStream readConfigFile() {
102102
InputStream configFile = this.getClass().getResourceAsStream("/HomeserverTest.conf");
103103
if (configFile != null) {
104104
try (BufferedReader buffer = new BufferedReader(new InputStreamReader(configFile))) {
105-
Map<String, String> configValues = buffer.lines().filter(line -> !line.startsWith("#")).collect(
106-
Collectors.toMap(line -> line.split("=")[0].trim(), line -> line.split("=")[1].trim()));
105+
Map<String, String> configValues = buffer.lines()
106+
.filter(line -> !line.startsWith("#") && !line.isEmpty()).collect(
107+
Collectors.toMap(line -> line.split("=")[0].trim(), line -> line.split("=")[1].trim()));
107108

108109
port = Integer.valueOf(configValues.get("Port"));
109110
hostname = configValues.get("Hostname");

0 commit comments

Comments
 (0)