mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 21:37:28 +01:00
Fix crash when version_history.json is empty (#9871)
This commit is contained in:
parent
22672b4be2
commit
9db92731a1
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue