13
0
geforkt von Mirrors/Paper

Fix crash when version_history.json is empty (#9871)

Dieser Commit ist enthalten in:
Warrior 2023-10-29 00:24:54 +02:00
Ursprung 22672b4be2
Commit 9db92731a1

Datei anzeigen

@ -116,6 +116,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return;
+ }
+
+ if (currentData == null) {
+ // Empty file
+ currentData = new VersionData();
+ currentData.setCurrentVersion(version);
+ writeFile(path);
+ return;
+ }
+
+ if (!version.equals(currentData.getCurrentVersion())) {
+ // The version appears to have changed
+ currentData.setOldVersion(currentData.getCurrentVersion());