Ensure that slices have been allocated when entering array

This commit is contained in:
Thomas Pelletier
2021-02-19 08:53:19 -05:00
parent 7f9822db35
commit 978143ce99
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -65,6 +65,10 @@ func (u *unmarshaler) ArrayBegin() {
return
}
u.builder.Save()
u.err = u.builder.EnsureSlice()
if u.err != nil {
return
}
if u.assign {
u.assign = false
} else {