diff options
author | Jake Potrebic <[email protected]> | 2023-09-21 22:41:27 -0700 |
---|---|---|
committer | Jake Potrebic <[email protected]> | 2023-09-21 22:41:27 -0700 |
commit | 2cee84193ce938bb8a7b3a02f4b0cb89be9759a3 (patch) | |
tree | bfe458cf6875a1b9b941d5cd37c4c3f2fb436080 /patches/removed | |
parent | a62835bbb19eb5874160b1040d47364fe1fcb3f3 (diff) | |
download | Paper-2cee84193ce938bb8a7b3a02f4b0cb89be9759a3.tar.gz Paper-2cee84193ce938bb8a7b3a02f4b0cb89be9759a3.zip |
and some more
Diffstat (limited to 'patches/removed')
-rw-r--r-- | patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch b/patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch new file mode 100644 index 0000000000..981f61ef05 --- /dev/null +++ b/patches/removed/1.20.1/0559-Throw-proper-exception-on-empty-JsonList-file.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Sun, 1 Nov 2020 16:43:11 +0100 +Subject: [PATCH] Throw proper exception on empty JsonList file + + +diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java +index 08173a6e0b7e46c041a81d6b51d77a0aea182525..9e8112fbc40a1d89c0f73ea4452e0fa1bb459bf4 100644 +--- a/src/main/java/net/minecraft/server/players/StoredUserList.java ++++ b/src/main/java/net/minecraft/server/players/StoredUserList.java +@@ -182,6 +182,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> { + + try { + JsonArray jsonarray = (JsonArray) StoredUserList.GSON.fromJson(bufferedreader, JsonArray.class); ++ com.google.common.base.Preconditions.checkState(jsonarray != null, "The file \"" + this.file.getName() + "\" is either empty or corrupt"); // Paper + + this.map.clear(); + Iterator iterator = jsonarray.iterator(); |