Skip to content

Commit

Permalink
Allow null for LazySettings(String)
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed May 27, 2023
1 parent 7694f72 commit dfd60c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions library/src/main/java/xyz/srnyx/lazylibrary/LazySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ public class LazySettings {
/**
* Creates a new LazySettings instance from a file
*
* @param fileName the name of the file to load settings from
* @param fileName the name of the file to load settings from (without {@code .yml}), defaults to {@code config}
*/
public LazySettings(@NotNull String fileName) {
public LazySettings(@Nullable String fileName) {
if (fileName == null) fileName = "config";
file = new LazyFile(fileName, NodeStyle.BLOCK, true);
token = file.yaml.node("token").getString();
database = file.yaml.node("database").getString();
Expand All @@ -93,10 +94,10 @@ public LazySettings(@NotNull String fileName) {
}

/**
* Creates a new {@link LazySettings} instance from the {@code settings.yml} file
* Creates a new {@link LazySettings} instance from the {@code config.yml} file
*/
public LazySettings() {
this("config");
this(null);
}

/**
Expand Down

0 comments on commit dfd60c6

Please sign in to comment.