From cc1cd6874d34865cb6d9645afc9293cf27d4b61b Mon Sep 17 00:00:00 2001 From: Tnze Date: Sun, 13 Mar 2022 12:17:21 +0800 Subject: [PATCH] fix nbt test panic --- nbt/decode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbt/decode.go b/nbt/decode.go index 8bdbe94..8401ca4 100644 --- a/nbt/decode.go +++ b/nbt/decode.go @@ -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++ {