mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 00:47:39 +01:00
Validate index when reading structured data type (#4020)
This commit is contained in:
parent
92dedfb950
commit
a45985ed58
@ -50,7 +50,7 @@ public class StructuredDataType extends Type<StructuredData<?>> {
|
||||
public StructuredData<?> read(final ByteBuf buffer) {
|
||||
Preconditions.checkNotNull(types, "StructuredDataType has not been initialized");
|
||||
final int id = Types.VAR_INT.readPrimitive(buffer);
|
||||
final StructuredDataKey<?> key = this.types[id];
|
||||
final StructuredDataKey<?> key = key(id);
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("No data component serializer found for id " + id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user