mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FIX] Crash corrupted sessions.json
This commit is contained in:
parent
ea7159dba6
commit
5b5da76bff
1 changed files with 4 additions and 4 deletions
|
@ -102,8 +102,8 @@ public void dumpSessionsData() {
|
||||||
Path path = Paths.get(dumpFile);
|
Path path = Paths.get(dumpFile);
|
||||||
try (Writer writer = IOHelper.newWriter(path)) {
|
try (Writer writer = IOHelper.newWriter(path)) {
|
||||||
Launcher.gsonManager.gson.toJson(dumpedData, writer);
|
Launcher.gsonManager.gson.toJson(dumpedData, writer);
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
logger.error(e);
|
logger.error("Sessions can't be saved", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ public void loadSessionsData() {
|
||||||
DumpedData data = Launcher.gsonManager.gson.fromJson(reader, DumpedData.class);
|
DumpedData data = Launcher.gsonManager.gson.fromJson(reader, DumpedData.class);
|
||||||
clientSet.putAll(data.clientSet);
|
clientSet.putAll(data.clientSet);
|
||||||
uuidIndex.putAll(data.uuidIndex);
|
uuidIndex.putAll(data.uuidIndex);
|
||||||
} catch (IOException e) {
|
} catch (Throwable e) {
|
||||||
logger.error(e);
|
logger.error("Sessions can't be loaded", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue