3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 04:20:04 +01:00

Don't try to deserialize a null string in legacy method

Dieser Commit ist enthalten in:
Riley Park 2021-02-23 13:40:49 -08:00
Ursprung 9bcd08cb3c
Commit aa282a1a04
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: D831AF236C834E45

Datei anzeigen

@ -1612,7 +1612,7 @@ index 3a782294c15e2c2592976858e28ec33f049cb65e..772c6b2fa50deac27e5ed112e6d9f9dd
public String getCustomName() {
TileEntityEnchantTable enchant = this.getSnapshot();
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
index 81f6bf5533288ed90e2f1f4d421d54195d9650c7..4daa39abc7ec1cae91d917a747efb192c2ca05eb 100644
index 81f6bf5533288ed90e2f1f4d421d54195d9650c7..d742f72215f6a9a2b562182fd57fd9acc59c9818 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
@@ -13,8 +13,10 @@ import org.bukkit.craftbukkit.util.CraftChatMessage;
@ -1688,7 +1688,7 @@ index 81f6bf5533288ed90e2f1f4d421d54195d9650c7..4daa39abc7ec1cae91d917a747efb192
public void setLine(int index, String line) throws IndexOutOfBoundsException {
- getLines()[index] = line;
+ this.loadLines();
+ this.lines.set(index, io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(line)); // Paper
+ this.lines.set(index, line != null ? io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(line) : net.kyori.adventure.text.Component.empty()); // Paper
}
@Override