Skip to content

Commit

Permalink
Hotfix.
Browse files Browse the repository at this point in the history
-Fixed: ParsedValues crash when the parsing failed.
-Fixed: DefaultConfigs with proxies were crashing if the subfolder didn't exist
  • Loading branch information
Speiger committed Feb 17, 2024
1 parent 9a94f52 commit dff78ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/carbonconfiglib/config/ConfigEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ public ParseResult<Boolean> canSetArray(List<String> entries) {
if(entries == null) return ParseResult.partial(false, NullPointerException::new, "Value isn't allowed to be null");
for(int i = 0,m=entries.size();i<m;i++) {
ParseResult<T> result = serializer.deserialize(Helpers.splitArray(entries.get(i), ";"));
if(result.hasError()) return result.onlyError();
if(result.hasError()) return result.withDefault(false);
ParseResult<Boolean> valid = serializer.isValid(result.getValue());
if(valid.hasError()) return valid;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/carbonconfiglib/config/ConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void createDefaultConfig() {
Path baseFolder = proxy.getBasePaths(createConfigFile(Paths.get("")));
Path file = createConfigFile(baseFolder);
if(Files.notExists(file)) {
Helpers.ensureFolder(file.getParent());
save(file);
wasSaving--;
}
Expand Down

0 comments on commit dff78ac

Please sign in to comment.