Skip to content

Commit a06da69

Browse files
author
yitzy299
committed
Fix NPE when no config file present
1 parent f58b40a commit a06da69

File tree

1 file changed

+5
-1
lines changed
  • src/main/java/com/github/quiltservertools/wires/config

1 file changed

+5
-1
lines changed

src/main/java/com/github/quiltservertools/wires/config/Config.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ public Config() {
3333
try {
3434
this.json = new JsonParser().parse(new String(Files.readAllBytes(Paths.get(path)))).getAsJsonObject();
3535
muted = initMuted();
36+
Wires.LOGGER.info("Loaded Wires config");
3637
} catch (IOException e) {
37-
e.printStackTrace();
38+
muted = new ArrayList<>();
39+
Wires.LOGGER.info("Unable to find existing Wires config file");
40+
Wires.LOGGER.info("A config file will be created on server shutdown");
3841
}
3942
this.serverMute = new ServerMute();
4043
this.staffChat = new StaffChat();
44+
4145
}
4246

4347
private List<Mute> initMuted() {

0 commit comments

Comments
 (0)