fix nbt test panic
This commit is contained in:
@ -257,7 +257,7 @@ func (d *Decoder) unmarshal(val reflect.Value, tagType byte) error {
|
|||||||
} else if vt.Kind() != reflect.Slice {
|
} else if vt.Kind() != reflect.Slice {
|
||||||
return errors.New("cannot parse TagLongArray to " + vt.String() + ", it must be a 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:
|
case reflect.Int64:
|
||||||
buf := reflect.MakeSlice(vt, int(aryLen), int(aryLen))
|
buf := reflect.MakeSlice(vt, int(aryLen), int(aryLen))
|
||||||
for i := 0; i < int(aryLen); i++ {
|
for i := 0; i < int(aryLen); i++ {
|
||||||
|
Reference in New Issue
Block a user