19 lines
1009 B
Diff
19 lines
1009 B
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||
|
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/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||
|
index 1fc0139cb9694ddea41f57d95774c3b47e8530c5..8da5f976109accc84b26ec4045776aa8a9799f3d 100644
|
||
|
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||
|
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||
|
@@ -187,6 +187,7 @@ public abstract class JsonList<K, V extends JsonListEntry<K>> {
|
||
|
|
||
|
try {
|
||
|
JsonArray jsonarray = (JsonArray) JsonList.b.fromJson(bufferedreader, JsonArray.class);
|
||
|
+ com.google.common.base.Preconditions.checkState(jsonarray != null, "The file \"" + this.c.getName() + "\" is either empty or corrupt"); // Paper
|
||
|
|
||
|
this.d.clear();
|
||
|
Iterator iterator = jsonarray.iterator();
|