Skip to content

Commit b5319db

Browse files
Check if item is null in 1.17.1->1.17 book conversion (#826)
1 parent 94c7551 commit b5319db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

common/src/main/java/com/viaversion/viabackwards/protocol/v1_17_1to1_17/Protocol1_17_1To1_17.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ protected void registerPackets() {
102102
boolean signing = wrapper.read(Types.BOOLEAN);
103103
wrapper.passthrough(Types.VAR_INT); // Slot comes first
104104

105+
if (item == null) {
106+
wrapper.write(Types.VAR_INT, 0); // Pages length
107+
wrapper.write(Types.BOOLEAN, false); // Optional title
108+
return;
109+
}
110+
105111
CompoundTag tag = item.tag();
106112
ListTag<StringTag> pagesTag;
107113
StringTag titleTag = null;

0 commit comments

Comments
 (0)