FileSaver close FileReader (#252)

* Update FileSaver.java

* Update FileSaver.java
This commit is contained in:
RacoonDog 2023-09-24 09:13:32 -04:00 committed by GitHub
parent c6cb3c0ee2
commit fa36d64a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,8 +43,8 @@ public abstract class FileSaver {
public void init() { public void init() {
if (file.exists()) { if (file.exists()) {
JsonObject parentNode = null; JsonObject parentNode = null;
try { try (final FileReader fr = new FileReader(file)) {
parentNode = ViaFabricPlus.GSON.fromJson(new FileReader(file), JsonObject.class).getAsJsonObject(); parentNode = ViaFabricPlus.GSON.fromJson(fr, JsonObject.class);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }