pk.NBT shouldn't panic: #98

This commit is contained in:
Tnze
2021-04-02 12:28:22 +08:00
parent c6255de745
commit 0bd427af06

View File

@ -436,7 +436,7 @@ type nbtField struct{ V interface{} }
func (n nbtField) WriteTo(w io.Writer) (int64, error) {
var buf bytes.Buffer
if err := nbt.NewEncoder(&buf).Encode(n.V); err != nil {
panic(err)
return 0, err
}
return buf.WriteTo(w)
}