Skip to content

Commit

Permalink
Ignore if yamlLoaderOptions haven't been found
Browse files Browse the repository at this point in the history
  • Loading branch information
P3ridot committed Oct 2, 2022
1 parent 68395e8 commit 608172c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/net/citizensnpcs/api/util/YamlStorage.java
Expand Up @@ -119,7 +119,7 @@ public String toString() {
}

private void tryIncreaseMaxCodepoints(FileConfiguration config) {
if (SET_CODEPOINT_LIMIT == null)
if (LOADER_OPTIONS == null || SET_CODEPOINT_LIMIT == null)
return;
try {
LoaderOptions options = (LoaderOptions) LOADER_OPTIONS.get(config);
Expand Down Expand Up @@ -344,13 +344,12 @@ public String toString() {
try {
LOADER_OPTIONS = YamlConfiguration.class.getDeclaredField("yamlLoaderOptions");
LOADER_OPTIONS.setAccessible(true);
} catch (Exception e) {
e.printStackTrace();
} catch (Exception ex) {
}
try {
SET_CODEPOINT_LIMIT = LoaderOptions.class.getMethod("setCodepointLimit", int.class);
SET_CODEPOINT_LIMIT.setAccessible(true);
} catch (Exception e) {
} catch (Exception ex) {
}
}
}

0 comments on commit 608172c

Please sign in to comment.