Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-16 04:50:08 +01:00
Validate index when reading structured data type (#4020)
Dieser Commit ist enthalten in:
Ursprung
92dedfb950
Commit
a45985ed58
@ -50,7 +50,7 @@ public class StructuredDataType extends Type<StructuredData<?>> {
|
|||||||
public StructuredData<?> read(final ByteBuf buffer) {
|
public StructuredData<?> read(final ByteBuf buffer) {
|
||||||
Preconditions.checkNotNull(types, "StructuredDataType has not been initialized");
|
Preconditions.checkNotNull(types, "StructuredDataType has not been initialized");
|
||||||
final int id = Types.VAR_INT.readPrimitive(buffer);
|
final int id = Types.VAR_INT.readPrimitive(buffer);
|
||||||
final StructuredDataKey<?> key = this.types[id];
|
final StructuredDataKey<?> key = key(id);
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
throw new IllegalArgumentException("No data component serializer found for id " + id);
|
throw new IllegalArgumentException("No data component serializer found for id " + id);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren