stackitem: don't overwrite error when serializing Item

We must get out as quickly as possible.
This commit is contained in:
Roman Khimov 2021-07-06 17:51:46 +03:00
parent e34fa2e915
commit 1b7b7e4bec

View file

@ -39,6 +39,9 @@ func EncodeBinaryStackItemAppExec(item Item, w *io.BinWriter) {
} }
func serializeItemTo(item Item, w *io.BinWriter, allowInvalid bool, seen map[Item]bool) { func serializeItemTo(item Item, w *io.BinWriter, allowInvalid bool, seen map[Item]bool) {
if w.Err != nil {
return
}
if seen[item] { if seen[item] {
w.Err = errors.New("recursive structures can't be serialized") w.Err = errors.New("recursive structures can't be serialized")
return return