fix: an emergency fix that probably doesn't work

This commit is contained in:
ChomeNS
2024-12-03 20:17:04 +07:00
parent e045d88cfc
commit 4ef6e334b0
2 changed files with 5 additions and 3 deletions

View File

@@ -49,8 +49,10 @@ public class PersistentDataUtilities {
lock.lock();
try (BufferedWriter writer = Files.newBufferedWriter(path, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) {
writer.write(gson.toJson(jsonObject));
} catch (IOException e) {
final JsonElement copy = jsonObject.deepCopy();
writer.write(gson.toJson(copy));
} catch (Exception e) {
e.printStackTrace();
} finally {
lock.unlock();