fix nbt test panic

This commit is contained in:
Tnze
2022-03-13 12:17:21 +08:00
parent 2aace6b51a
commit cc1cd6874d

View File

@ -257,7 +257,7 @@ func (d *Decoder) unmarshal(val reflect.Value, tagType byte) error {
} else if vt.Kind() != reflect.Slice {
return errors.New("cannot parse TagLongArray to " + vt.String() + ", it must be a slice")
}
switch val.Type().Elem().Kind() {
switch vt.Elem().Kind() {
case reflect.Int64:
buf := reflect.MakeSlice(vt, int(aryLen), int(aryLen))
for i := 0; i < int(aryLen); i++ {