Skip to content

Commit

Permalink
only try to read server.properties if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed May 9, 2024
1 parent 9594a1f commit ec3237f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/main/java/org/comroid/mcsd/core/ServerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ public AlmostComplete<Properties> updateProperties() throws IOException {
var files = component(FileModule.class).assertion("No file module is specified");
files.mkDir(serverProperties);
final var prop = new Properties();
try (var input = files.readFile(serverProperties)) {
prop.load(input);
}
if (files.exists(serverProperties))
try (var input = files.readFile(serverProperties)) {
prop.load(input);
}

// generic
prop.setProperty("server-port", String.valueOf(server.getPort()));
Expand Down

0 comments on commit ec3237f

Please sign in to comment.