fix: add missing addpair error check #4

Open
spacewander wants to merge 1 commits from spacewander/miss_check into master

View File

@ -322,6 +322,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s
if v then if v then
used[k] = true used[k] = true
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state) buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
if not buflen then return nil, msg end
prev = true -- add a seperator before the next element prev = true -- add a seperator before the next element
end end
end end