Skip to content

Commit

Permalink
allow no config
Browse files Browse the repository at this point in the history
  • Loading branch information
danthe1st committed Mar 9, 2024
1 parent 0a00b0a commit 4450f96
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ private <T> List<T> emptyIfNull(List<T> preForwardRules) {
}

public static Config load(Path path) throws IOException {
if(!Files.exists(path)) {
return new Config(null, null, null);
}
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
try(Reader reader = Files.newBufferedReader(path)){
return mapper.readValue(reader, Config.class);
Expand Down

0 comments on commit 4450f96

Please sign in to comment.