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

This commit is contained in:
Riley Park 2021-02-23 13:40:49 -08:00
parent 75252e970b
commit 2e594bd059

View file

@ -1688,7 +1688,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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